Use sub domains for temporary site access

EliteIT

Registered
Mar 9, 2014
1
0
1
cPanel Access Level
Root Administrator
I provide web hosting to clients and am looking for an alternate method to the typical /http://SERVERIP/~username method for accessing a site before DNS has been updated.

That method usually works but now I'm having web designers tell me that when they are trying to work on Wordpress sites before going live with them they are being directed to the actual domain name ex: domain.com when clicking on certain links inside the wordpress configuration, instead of staying on the temporary IP address link above. This is causing issues because the domain in question may be live on another server and it appears my server is doing a DNS lookup on the domain and redirecting rather than just staying on the temp link and navigating through that way.

I am wondering if there is an easy way to setup sub domains to allow people to access their sites temporarily before switching DNS and going live. I basically want to follow the format subdomain.srvr3.domain.co (srvr3.domain.co is the host name of the server) for each new cPanel account I create.
 

robb3369

Well-Known Member
Mar 1, 2008
122
1
68
cPanel Access Level
Root Administrator
We do this all the time... Setup the client domain in WHM just like you would (clientsite.com) and then park your test subdomain on it (client.test-domain.com) either from cpanel or whm...

This way once the site goes live, you'll basically remove the subdomain, run a wordpress specific search and replace tool /https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ to update the db with the new hostname and then remove the SnR script from the server.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello :)

The easiest solution is to simply have the web designers update the hosts file on their machines so that the domain name resolves to the IP address of the server. This will allow them to view the website before the DNS is updated without using the Apache Mod_Userdir tweak.

hosts (file) - Wikipedia, the free encyclopedia

Thank you.
 

dankoni

Member
Apr 4, 2014
5
0
1
cPanel Access Level
Root Administrator
Hello :)

The easiest solution is to simply have the web designers update the hosts file on their machines so that the domain name resolves to the IP address of the server. This will allow them to view the website before the DNS is updated without using the Apache Mod_Userdir tweak.

hosts (file) - Wikipedia, the free encyclopedia

Thank you.
GAH! Why didn't I think of this a week ago?! lol