[英]Apache reverse proxy and infinite loop
I have Server A and B. Server A hosts the main site www.example.com, Server B hosts another site using the subdomain test.example.com. 我有服务器A和B.服务器A托管主站点www.example.com,服务器B使用子域test.example.com托管另一个站点。 On Server AI set up a reverse proxy, so that the Wordpress site running on test.example.com can be accessed via www.example.com/test 在服务器AI上设置反向代理,以便可以通过www.example.com/test访问test.example.com上运行的Wordpress站点
Now I want the subdomain test.example.com to be "invisible" for the user, so that a request to test.example.com will redirect to www.example.com/test. 现在,我希望子域test.example.com对用户来说是“不可见的”,因此对test.example.com的请求将重定向到www.example.com/test。 Obviously, this got me into an infinite loop. 显然,这让我陷入了无限循环。 I tried different things to break the loop to no avail. 我尝试了不同的东西来打破循环无济于事。 Is there a way to do this? 有没有办法做到这一点?
<VirtualHost *:80>
ServerName test.example.com
RedirectMatch permanent ^/(.*) www.example.com/test
</VirtualHost>
Add the above apache conf and restart apache. 添加上面的apache conf并重启apache。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.