We often get asked a question about how to preview new WordPress site before the domain has been pointed to your account. Below we came up with instructions for both Mac and PC.
The best way to simulate this is to open up your hosts file and make some changes to it and then open your site in a browser directly by the domain name itself.
On a Windows computer
Open up notepad as an administrator. Here’s a good article about how to do this properly. From the notepad browse to c:\windows\system32\drivers\etc\ You should be able to see the hosts file there. Make sure Show all files is selected.
You will see the contents of that file. It will show you what format to use when entering information into it. For example: If your server’s IP address is 188.8.131.52 and the domain name is mydomain.com, you will have to enter the following line:
This will tell your computer to open mydomain.com at IP address of 184.108.40.206. It will effectively bypass your provider’s DNS servers just for that domain. This is perfect for test as no changes to the actual site will be required and all links will work perfectly!
Save the file. You are now ready to preview new WordPress site.
On a Mac or Linux computer
The hosts file is located in the /etc folder. You should open it using one of your favorite text editors and make exactly the same changes as above. Don’t forget to remove that line after you’ve done testing. This is so that you are not confused in the future when the IP of the site for some reason changes.
Preview new WordPress site
You should be now able to type in the domain name in one of your browsers such as Chrome, FireFox or Internet Explorer and see the site at the new location.