我有Windows Server 2012的aws ec2实例,并且正在为PHP Web服务运行wamp服务器。我想将端口80的所有请求重定向到8085,因为我已经将apache服务器端口从80更改为8085。我们如何将来自端口80的请求重定向到8085?谁能帮我这个忙吗?
只需在Apache配置文件/etc/httpd/conf
中进行以下更改
<VirtualHost _default_:80>
DocumentRoot /var/www/html/
RewriteEngine On
RewriteRule ^.*$ http://%{HTTP_HOST}:8085%{REQUEST_URI}
</VirtualHost>
此后只需重新启动Apache服务器。
service apache2 restart