Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress Apache反向代理和无限循环_Wordpress_Apache_Reverse Proxy - Fatal编程技术网

Wordpress Apache反向代理和无限循环

Wordpress Apache反向代理和无限循环,wordpress,apache,reverse-proxy,Wordpress,Apache,Reverse Proxy,我有服务器A和B。服务器A承载主站点www.example.com,服务器B承载另一个使用子域test.example.com的站点。在服务器A上,我设置了一个反向代理,这样运行在test.example.com上的Wordpress站点就可以通过www.example.com/test访问 现在,我希望子域test.example.com对用户是“不可见的”,这样,对test.example.com的请求将重定向到www.example.com/test。 显然,这让我陷入了一个无限循环。我尝

我有服务器A和B。服务器A承载主站点www.example.com,服务器B承载另一个使用子域test.example.com的站点。在服务器A上,我设置了一个反向代理,这样运行在test.example.com上的Wordpress站点就可以通过www.example.com/test访问

现在,我希望子域test.example.com对用户是“不可见的”,这样,对test.example.com的请求将重定向到www.example.com/test。 显然,这让我陷入了一个无限循环。我尝试了不同的方法来打破这个循环,但没有成功。 有办法做到这一点吗?


<VirtualHost *:80>
  ServerName test.example.com
  RedirectMatch permanent ^/(.*) www.example.com/test
</VirtualHost>
ServerName test.example.com RedirectMatch permanent^/(*)www.example.com/test
添加上述apache配置并重新启动apache。


ServerName test.example.com
RedirectMatch permanent^/(*)www.example.com/test
添加上面的apacheconf并重新启动apache