Often time developers have to create a new design for an existing website on a new server. However, they regularly face the challenging task of access this new URL without switching over the DNS that points to it.
There are three ways to mitigate this issue:
1. Create a subdomain of the main site such as staging.sitename.com and use it on the new server and point DNS IP for staging.sitename.com to our server. Once ready to migrate, change the account from staging.sitename.com to sitename.com
2. In Windows, MAC or Linux, there is a file known as the HOSTS file. Download Host File Editor such as https://hostsfileeditor.codeplex.com/
Inside the HOSTS file editor, update your local settings to point to the new website.
First, obtain your website IP address. This is available under cPanel interface , on the right side under "Shared IP Address":
Second, use one of the HOSTS file editors above to add the new website using the shared IP address. Example:
site name: test-site.com
IP address in cPanel: 192.211.125.154
Then the hosts file content will be:
192.211.125.154 test-site.com
192.211.125.154 www.test-site.com
Using any of the above two methods will help you to view a website on an IP address or server without pointing the DNS to that server.
Remember, clear your browser cache (or close your browser and re-open it) every time you update the HOSTS file.
HOSTS file location on Windows: C:\windows\system32\drivers\etc\
HOSTS file location on Mac/Linux: /etc/hosts