BE SOCIAL & SHARE:

When transferring to a new hosting provider, the most important thing for you to do is to test your website before pointing your domain. This will help guarantee a successful migration by ensuring your site is 100% functional before making the switch.

What you will need:

  • Your GreenGeeks service server IP. You can find this in your service welcome email, or by contacting support to confirm the correct IP address you’ll need to use.

Redirecting via System HOSTS File

The best way to test your website is by staging your domain via your computer system’s HOSTS file. This method avoids having to wait for DNS propagation which could take quite a while.

However, this will only work for the local system. If someone else would like to test the site, they will need to follow the same steps for modifying the HOSTS file.

Open your text editor of choice. Windows users will need to use Notepad with administrative privileges in order to be able to modify the HOSTS file (You can right click Notepad and Run as Administrator if you need).

Open your system’s HOSTS file. The location of this file is as follows:

Windows: C:\Windows\System32\drivers\etc\hosts
Linux / Mac:  /etc/hosts

HOSTS Files

If you don’t see anything in the etc folder, change “Text Documents” to “All Files” in Notepad. This will show everything in the folder including the hosts file.

All Files

Using your GreenGeeks server IP, add the following lines to the file on a new line at the bottom of the HOSTS file:

SERVER_IP_HERE yourdomain.com
SERVER_IP_HERE www.yourdomain.com

Server Lines

Note that SERVER_IP_HERE needs to be replaced with your actual server IP address. The yourdomain.com references should be replaced with your actual domain name.

Here is an example of what your entry should look like:

13.57.24.68 myawesomesite.com
13.57.24.68 www.myawesomesite.com

DNS Example

Go to File and Save the hosts file. You don’t want to use “Save As” because you’re keeping the hosts file as-is with your added redirect entry.

Save Hosts

Restart your web browser and navigate to your website. The site will now load from the GreenGeeks server!

Removing the Redirect Entry

To revert this change, simply remove the lines you added and save the file again. This will direct the site back to the original host. You may need to do this before visiting your domain registrar to change the nameserver.

Comments

  1. James Walters

    Thanks for this. There’s one thing you might want add at the end: “You may need to delete the extra line from /etc/hosts and restart your browser before you go to your domain registrar to change the nameservers.”

  2. Rory

    This doesn’t work on mac OS X because the host file is locked by the operating system and cannot be edited by any user not even an admin.

  3. Kaumil Patel

    Hi James,

    Thanks for the suggestion. We already had “To revert this change, simply remove the line you added and save the file. This will direct the site back to the original host.” at the end of the article, but we’ve made it a bit more clear by adding it as its own bullet point.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.