Apache Account Browsing Trick – !! No Host file Changes !!

So we’ve just moved to a new server hosting company at my workplace and now are burdened with the ever so fun task of moving all our sites and domains across to the new box. For those not in the know, the main issue with this is we can’t change the DNS records for the nameserver at the registrar until we’ve duplicated and checked the sites on the new box, but how do you check a site if it’s pointing back to the old server address? Thus enters our redirect loop of doom.

Fortunately I found in the expanses of the web a neat trick to getting to the public_html folder of the accounts in your WHM without messing around in your host file. Simply putting the main address of the server, for example let’s just call it newserver.com, and then to get to the cPanel account named ‘Client1‘ which would usually resolve to client1.com we simply enter the address nameserver.com/~Client1 and voila. We can now browse the the site as normal!


 

EDIT: Turns out this trick is Apache specific, the tilde then user/cpanel account name, allows for browsing the user directory or public_html folder in the case of a web server.

Let the world know