In the Apache for the site mysiteA.com is registered

ProxyPass / http://mysiteB.com. 

Thus, the site page loads the page with mysiteB.com. All links lead to mysiteB.com / ... You need to do so that after the proxypass the host address is saved and all the links lead to mysiteA.com / ... I add the rule to the Apache:

 ProxyPass / http://mysiteB.com ProxyPreserveHost on 

This rule does not work. How to configure ProxyPreserveHost?

    2 answers 2

    Solution: since both sites work on the same server, you can make ProxyPass through localhost.

     <VirtualHost 127.0.0.1:80> ServerAlias mysiteB.com DocumentRoot /var/www/ </VirtualHost> <VirtualHost> ServerName mysiteA.com ProxyPreserveHost On ProxyPass / http://127.0.0.1/ </VirtualHost> 

      the proxypreservehost directive serves to transfer the request (using proxypass ) to the proxied http server in the http header of the host name ( mysitea.com in the given example), but not proxied ( mysiteb.com in the given example), what happens default.

      The links you watch are likely generated by the mysiteb.com site mysiteb.com . accordingly, your apache will not help you.