我想用一个apache重写重定向东西要到第二个文件夹的站点的根目录或/。不过,我当我去http://example.com/second/css/style.css它不拉http://example.com/css/style.css
我试过如下:Apache Reverse Proxy ReWrite但是当我把ProxyHTMLEnable在我的conf文件的Apache无法启动。
这就是我现在想。 Apache没有开始,但我没有得到期望的效果重定向:
<VirtualHost *:80>
ServerName example.com
ServerAdmin [email protected]
SetEnvIf Request_URI ".(jpg|jpeg|png|swf|css|gif|dat|ico|js)$" dontlog
#SetEnvIf Request_URI "/cron/" dontlog
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" varnishcombined
RewriteEngine On
RewriteRule ^second/(.*)$ /$1 [R=301,NC,L]
# ProxyRequests Off
# <Proxy *>
# Order deny,allow
# Allow from all
# </Proxy>
ProxyPass / http://127.0.0.1:8080/second/
ProxyPassReverse / http://127.0.0.1:8080/second/
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
有意者请将中的conf文件,因为我可以用0.0.0.0成功下方设置试试。
ProxyPreserveHost On
ProxyPass / http://0.0.0.0:8080/second/
ProxyPassReverse / http://0.0.0.0:8080/second/