Proxypass issue in apache

Posted by user116992 on Server Fault See other posts from Server Fault or by user116992
Published on 2012-04-10T09:02:46Z Indexed on 2012/04/10 11:32 UTC
Read the original article Hit count: 209

Filed under:

I am reverse proxying one site to another site. It's working nicely, but on some links it displays the original link. Here is my configuration

Original Site "mysite.com"

Second site configuration which is proxypassed on "mysite.com"

<VirtualHost *:80>
   ServerName test.mysite.com
   ServerAlias www.test.mysite.com test.mysite.com

   ErrorLog /var/log/apache2/test.mysite_log.log
   TransferLog /var/log/apache2/test.mysite-access_log.log
   LogLevel info
   LogFormat "%h %l %u %t \"%r\" %>s %b %T" common

   ProxyPass / http://mysite.com/
   ProxyPass / http://mysite.com/
   ProxyPassReverse / http://mysite.com/
</VirtualHost>

Now, everything is working well, but the problem is that when I go to some specific link it redirects me to original link. For Example, there are two sections on my page: "about-us" and "inquiry". When I click on "about-us" it takes me to "http://test.mysite.com/about-us" which is ok

When I click on "inquiry" it takes me to "http://mysite.com/inquiry" which is not correct it must be "http://test.mysite.com/inquiry".

I think I've missed some thing to add in configuration file but I can't figure it out.

© Server Fault or respective owner

Related posts about apache2