Setting up a new website on a new server or with a different hosting provider while the existing website is still live presents some challenges.
Https configuration
Firstly, to test https configurations configuration, you need to use the correct URL. Most hosting control panels supply a temporary URL, or you can alias your own spare
If you try to test
Redirections
If you have redirections configured in your web.config or .htaccess file, and they’re configured for your primary URL, then testing with a temporary URL may yield unpredictable results. Particularly if some rules refer to an absolute fully qualified URL, and others are relative to the root of the website, so are not dependent on the URL.
CMS Configuration
Some CMS’s like WordPress will often store the full URL in it’s settings or in data in the database. WordPress also stores image URL’s in it’s posts and pages using absolute URL’s.
If you set up a new hosting space with a temporary URL, then configure WordPress and start adding content, you’re going to be bound that that temporary URL, in the short term at least.
If you then point your live URL to the WordPress install and delete your temporary URL, you’ll have links to URL’s that don’t exist anymore, and you may even have issues where you’re unable to access your CMS admin area.
While they’re are plugins that you can use to work around these issues, they’re not always 100% effective.
The workaround
The easiest way to work around these issues is by using a
In
On a Windows PC, find Notepad in your start menu, then right click and select “Run as Administrator”. If you don’t do this, you won’t be able to save the file.
Open the
The file is documented and explains how to use it. To add a record, move to the bottom of the file and add the IP of the new server, then press the tab key, then add the domain/
103.234.60.52 mydomain.com.au
Save the file, then visit mydomain.com.au in a browser, and you will be directed to the new
To remove this workaround, remove the line from the hosts file and save again. If you want to retain this entry but disable it temporarily to get back to the live URL, add a hash to the beginning of the line.