How to preview your website using your hosts file

You want to move a website to your new hosting account, you've already moved all the files but would like to see first if the site is working before changing your nameservers. Or you've already changed your nameservers but don't want to wait for the changes to propagate. This guide explains how you can preview your website.

First of all, it should be noted that traditional cPanel preview urls (like http://your_server_ip/~your_username) are not available on our servers due to the inherent security flaws of the module.

However, you can preview your website by changing your hosts file. First of all, you need to lookup your website IP. To do so, go to the Server Information menu (the link is in the sidebar of your control panel) and find the Shared IP Address.

Next, you'll need to edit the hosts file of your computer. By editing the hosts file, you can override the DNS settings for a domain for your own computer only. This guide explains how to edit the hosts file for most operating systems: http://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/.

Using the hosts file changes, you can point your domain name to your website IP address (as well as any subdomains like the www. subdomain). After that, when entering your domain name in your browser, it will access the IP address you configured in your hosts file rather than what's configured through DNS. Hosts file changes don't need to propagate, so the changes will work immediately.

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

Moving your website

If your website doesn't use MySQL databases, moving your site is very easy. Simply upload all...

What are the nameservers?

When pointing a domain name to your hosting account, you need to set the nameservers for the...

Powered by WHMCompleteSolution