简体   繁体   English

Apache反向代理和无限循环

[英]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.

相关问题 从Nginx到Dockerized Wordpress的反向代理导致无限重定向循环 - Reverse proxy from Nginx to Dockerized Wordpress is causing an infinite redirect loop Nginx作为Apache的反向代理 - Nginx as a Reverse Proxy for Apache 在CentOS中使用Nginx作为Apache上Wordpress的反向代理 - Using Nginx as reverse proxy for wordpress on Apache in CentOS Nginx 反向 SSL 代理的问题 Apache 的 ZFDE31686817FE502906DB356 - Problems with Nginx Reverse SSL Proxy for Apache for WordPress WordPress站点的Apache反向代理不应该通过子路径 - Apache Reverse Proxy to a Wordpress site passes subpath when it shouldn't Docker +反向代理(nginx)+子目录作为根+ wordpress(apache)+多站点 - Docker + reverse-proxy(nginx) + subdirectory as root + wordpress(apache) + multisite Apache 后面的 WordPress 站点反向代理不断重定向到本地主机 - WordPress site behind Apache reverse proxy keeps redirecting to localhost 使用 NGINX 作为 apache 的反向代理时,Wordpress 永久链接返回 404 - Wordpress Permalinks return 404 when using NGINX as a reverse proxy to apache Nginx反向代理到apache-wordpress可以工作,但是proxy_pass到外部URL失败 - nginx reverse proxy to apache-wordpress works but proxy_pass to external url fails 网站根上的Wordpress重定向循环。 Nginx代理Apache - Wordpress redirect loop on site root. Nginx proxy apache
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM