Edit Websites Or Login To WordPress On A Temporary URL

Share Your Thoughts

When you sign up for a new web hosting package, you may have a situation where you need to get all the site files ready, in place before transferring an existing domain. Or, you may be adding the domain later and need to work on a temporary URL.

If you have a website that uses includes or with absolute paths in your page code, or run a database-driven CMS such as WordPress, you will ideally want to upload the files and not have to edit the URLs on the server.

This is where you need to edit your hosts file on your computer. The location of this file is:

Mac – Use Finder > Go > Go to Folder and type /private. Select the etc folder and use Get Info to make the folder writeable. The hosts file is in the /etc folder.

PC – C:windowssystem32driversetchosts

You can open and edit the file with TextEdit/Notepad or your favourite text editor. Go to the bottom of the file and enter the IP address supplied by your web hosting company, along with the domain name. Enter this twice, with and without the ‘www’ like this:

123.456.78.910 yourdomain.com
123.456.78.910 www.yourdomain.com

Do not remove the localhost references already in the file!

Once you have done this, restart your web servers (I use MAMP) and for good measure, relaunch your browser to start a new session. You should now be able to view your site on the temporary URL or log in to your WordPress admin area and update the theme, add your plugins etc.

Website Advice , , ,


What do you think?

It's good to talk!

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

Please answer before submitting form * Time limit is exhausted. Please reload CAPTCHA.