我想在我的WAMPSERVER 2.0i安装上设置虚拟主机。目前,它看起来像这样:设置Apache虚拟主机和ProxyPass
http://domain/main
http://domain/sub1
http://domain/sub2
我需要设置它,以便1)访问http://domain/会重定向到http://domain/main,但2)http://domain/sub1和http://domain/sub2保持原样工作。
当我尝试使用反向代理这样
<VirtualHost *:80>
DocumentRoot "D:/WAMP/www"
ServerName domain
ProxyPass/http://domain/main/
ProxyPassReverse/http://domain/main/
ErrorLog "logs/error.log"
CustomLog "logs/access.log" common
</VirtualHost>
正常工作的第一选择。但是,试图访问http://domain/sub1或http://domain/sub2给我“从远程服务器读取错误” ......
我尝试添加像
ProxyPass /sub1/ http://domain/sub1/
ProxyPassReverse /sub1/ http://domain/sub1/
,但没有任何运气。
任何人都可以提供任何意见吗?谢谢!
是的,你说得对。代理并不是最好的主意。不知道为什么我从一开始就坚持下去...... – Jull 2010-09-27 23:06:17