Knowledgebase

Access / test / check a website that's just been transferred

If you need to check, test or access a new website that is only accessible on a temporary URL, you may need to edit the hosts file to properly test the website. This method of access can also be used to make changes to a staging website prior to the website going live, or to simply verify the outcome of a migration.

The location of the hosts file and how to edit this depends on the operating system you are using.

Further down this page, there are guides for Windows, Mac and Linux.


How the Hosts file works

By temporarily modifying your hosts file, you are basically "tricking" your computer into thinking that the DNS records have been updated on your Computer only. This allows you to access the website normally, but have it load from a different / specific server other than the server that is live to the rest of the world.

The hosts file itself needs to be updated with specific syntax, that we will have provided to you - for example:

127.0.0.1 mywebsite.com www.mywebsite.com

Once you've copide and pasted the info provided to you, you can save the file and then you can test the website on the new server using its normal domain name/URL ie. how you normally access the website.


Please Note
We provide this information in good faith but can take no responsibility for any inaccuracy, or indeed for any issue that may arise from your use of this information.  We recommend that you remove the changes made in the host file, once the testing has been completed.

 
==========

Windows

  1. Locate 'notepad' in the start menu




 2. Right click on notepad and select 'Run as Administrator' - this is required or your changes to the hosts file won't save correctly.

           

   
3. Once Notepad is open, click 'File' and then 'Open'

4. Browse/Navigate to the following folder location:      'C:\Windows\System32\drivers\etc'

  • First navigate to your C: drive
  • Then navigate to the Windows folder
  • Then find the System32 folder
  • Then select drivers
  • Then locate the etc folder

     
   

5. By default the Hosts file is hidden.  To be able to view it, you will need to change 'Text Documents (*.txt)' to 'All Files' in the bottom right "file type" box.

6. Once you see all the files, click on 'hosts' and if you wish you can first make a backup by using COPY/PASTE - to create a 'hosts - copy' backup. 

7. Next, select the hosts file and click 'Open' to open it.  You will see something similar to the below example.  On a new line (ideally at the bottom of the file), type in or paste the address details we should have provided to you.

Ensure that you use the details provided in the migration email for this section.

   
8. When done, save the file by clicking on 'File' and then 'Save'.  DO NOT close it yet!

9. You can now open your web browser and navigate to your website which should now be loading from our server.  When you have completed checks on your migrated site, you can let us know if everything is fine, or if something is not right.  You can then follow the above steps again to remove the changes you made to the hosts file, save it again and close it.


==========


Mac

1. Open Finder

 

2. Select 'Applications', and then 'Utilities'



You can also hold down the 'Control' and 'Shift' keys and press 'U'


3. Open 'terminal'




4. Type in 'sudo nano /private/etc/hosts'
(If this file is blank use 'sudo nano /etc/hosts')



5. Type in your computer's password and press 'Enter'
The screen will remain blank while doing this

6. Use the 'down arrow' key to navigate to the end of the file



7. Type in the details as required

8. Hold down the 'Control' key and press 'O' to save, then press 'Enter'

9. Hold down the 'Control' key and press 'X' to exit nano

10. You can now exit terminal

11. You can now open your web browser and navigate to your website which should now be loading from our server.  When you have completed checks on your migrated site, you can let us know if everything is fine, or if something is not right.  You can then follow the above steps again to remove the changes you made to the hosts file, save it again and close it.

 

==========



Linux

  1. Open a teminal window
  2. Type in 'sudo vi /etc/hosts'
  3. Type in your computer's password and press 'Enter'
    The screen will remain blank while doing this
  4. Use either the down arrow or 'j' to navigate to the bottom of the file
  5. Press 'i' to enter insert mode
  6. Type in the details as required
  7. When done press 'Esc' to exit insert mode
  8. To close the file press either 'Z' twice or type the following ':wq'
  9. You can now exit terminal
  10. You can now open your web browser and navigate to your website which should now be loading from our server.  When you have completed checks on your migrated site, you can let us know if everything is fine, or if something is not right.  You can then follow the above steps again to remove the changes you made to the hosts file, save it again and close it.
 


  • 167 Users Found This Useful
Was this answer helpful?

Related Articles

How do I delete the Purple Dog holding page?

This page is automatically created when you purchase webhosting from us. To remove the holding...

What hosting plans do you offer?

We offer a range of hosting plans suitable for a range of different business use purposes. You...

Can I upgrade / downgrade my hosting plan?

Upgrading: yes - and you should be able to do this from within your client account area (or just...

What is FTP and how do I use it?

What is FTP? FTP (File Transfer Protocol) is the simplest and fastest way to exchange files over...

Do you offer a hosting control panel?

For some types of accounts, we may provide access to a hosting control panel.  However, this is...