Hostaan.one WordPress plans from €0.99/mo for the 1st year (-67%). See Black Friday web hosting
Skip to content

Development Tools

Using a temporary address to route website traffic

When WordPress is installed on a new order but the domain does not yet point to our server, logging in to the WordPress admin interface does not work or redirects to the old server.

You can build new pages in WordPress or import content from the old site using a temporary address. There are two ways to use a temporary address:

1) Pointing the domain locally from your own computer

You can point the domain locally by editing your computer's hosts file. With this method you do not need to change the WordPress URL, but you can only reach WordPress from the computer whose hosts file you edited.

The routing line in the hosts file is identical on Windows and Mac computers. It consists of the server's IP address and the domain name that is requested from the server. Add the server's IPv4 and IPv6 addresses on their own lines, each followed by the website address. It is a good idea to add the address both with and without www, so that both requests go to the same place.

The easiest way to find the server's IP addresses is in the Plesk control panel: on the front page of the "Websites & Domains" view, at the bottom of the domain's section.



On Linux and Mac computers you can edit the hosts file by opening a terminal and running the command sudo nano /etc/hosts, which lets you edit the hosts file directly.


On Windows, open for example Notepad as an administrator.



Then open the hosts file in Notepad from C:\Windows\System32\drivers\etc\, and set the file filter to "All files" (the hosts file has no file extension). Select hosts and click "Open".




Once the edits are made, traffic from your computer goes directly to the target server. As far as your computer is concerned, the domain is located somewhere other than where it really is, so you can now log in to the WordPress admin.

After the site has been migrated and tested, remember to remove the lines you added to the hosts file, so that your computer goes back to reality and fetches the domain's DNS records from the network as normal.

2) The other option is to configure WordPress to use the Plesk control panel's preview address as follows:

In the Plesk control panel, go to "Websites & Domains" -> "Preview" and copy the preview address by right-clicking it (the address looks like this: http://domain.tld.XX-XXX-XXX-XX.hostaan.fi). Then go to the "Files" view.


Find the wp-config.php file in the httpdocs directory and open it by clicking it.


Next, look for the following lines in wp-config.php:
define('WP_HOME','http://domain.tld.XX-XXX-XXX-XX.hostaan.fi');
define('WP_SITEURL','http://domain.tld.XX-XXX-XXX-XX.hostaan.fi');

If these lines are not there already, you can add them to the file. It is an absolute requirement that they come before the "That's all, stop editing!" line (above it). A good place is, for example, right after the comment line /* Add any custom values between this line and the "stop editing" line. */

Paste the preview link you copied earlier on both lines, replacing the original address.



After that, go to WordPress Toolkit in the Plesk control panel and choose 'Update site URL' from the three-dot menu on the right, so that the temporary address is also updated in the WordPress Toolkit view.

You can now log in to WordPress with the 'Log in' button in WordPress Toolkit or directly at http://domain.tld.XX-XXX-XXX-XX.hostaan.fi/wp-login.php. You can see the username and password needed for logging in in the Plesk control panel under WordPress -> Settings (next to the Log in button).

After the domain has been moved, you need to replace these edited addresses with your original domain. It is best to do this at the latest when the domain transfer is actually done.

You can also click the "Update site URL" button in WP Toolkit once more. It fixes the URL if the domain already points to the server.

Read also

Back to category guides