简体   繁体   中英

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. 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

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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM