【发布时间】:2012-02-17 11:56:57
【问题描述】:
我尝试将 Apache 设置为代理,最终将对 JavaScript 文件的请求重写到不同的代码库。我设置了 Apache 并充当代理,但无论我做什么,它都不会使用下面显示的重写规则配置。
目前这一切都在我的本地机器上毁了。
<VirtualHost *:8000>
RewriteEngine on
RewriteRule "(.*)" "http://127.0.0.1/test.html" [P]
DocumentRoot "c:/wamp/www/ipvproxy"
ServerName ipvproxy
ProxyRequests On
ProxyVia On
<Proxy *>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Proxy>
工作配置
<VirtualHost aaa.bbb.ccc.ddd:8000>
DocumentRoot "c:/wamp/www/"
CustomLog "c:/wamp/logs/vhost.log" common
ErrorLog "c:/wamp/logs/vhost_error.log"
ProxyRequests On
<Proxy *>
Order deny,allow
Deny from all
Allow from all
</Proxy>
RewriteEngine on
RewriteLog "c:/wamp/logs/rewrite2.log"
RewriteLogLevel 9
RewriteRule .* http://127.0.0.1/test.html
</VirtualHost>
【问题讨论】:
标签: apache mod-rewrite mod-proxy