point from one server to subdirectory on another but both share same domain structure

TheMediaman

Registered
Apr 11, 2014
1
0
1
cPanel Access Level
Root Administrator
This is a question that has probably been asked 100 different ways before. I searched but I couldn't find specifics to my scenario.

I want to have weblinks point to another server but keep the domain structure in place. A client used subdirectory structure on their domain to house different entities. Let`s call them entity A, B and C so the current structure looks like http://www.clientdomain.com/A, http://www.clientdomain.com/B, and http://www.clientdomain.com/C. Entity B and C get extremely little traffic but have to be left operational and alone for the time being. Entity A needs to move to the new server and will be set up as a subdomain. This I know how to do in CPANEL. A new WP site will be on the main domain on the new server and have the menu links that need to link to Entity B and C at the old server.

Politics prevents a complete rebuild. Their current server is VPS unmanaged and the current webcode is a dog's breakfast. Not work fixing.

I will deploy new WP site at http://www.clientdomain.com and put another WP site as a subdomain http://www.entityA.clientdomain.com. This will allow me to move entity B and C to the new server to their own subdomain when politics allow.

So I point the DNS to the new server managed cpanel. The old server with Entity B and C is now just an IP address/subdirectory/index.html

I need to place menu links on the new main domain WP site on the new server that will point back to Entity B and C on the old server and rewrite the URLS so the old http://www.clientdomain.com/entityB and http://www.clientdomain.com/entityC paths remain intact. I don't want to reveal the old server IP address in the URL.

Is it as straight forward as inserting mod_rewrite code and ProxyPass, ProxyPassReverse code into the .htaccess file at the new server main domain to make this work?

I've read similar solutions but writing the proper code to facilitate this is above my paygrade.

Any help would be appreciated.

The new server would use

Apache Ver 2.2.26
PHP version 5.4.24
Linux
Cpanel 11.42.1
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463