Redirect htaccess localhost to IP

I’m currently working on a wordpress website using WAMP locally, I’ve got the site working fine on another local computer, however images aren’t showing they’re simply appearing as localhost/wp-content/etcetc instead of 10.0.1.2/wp-content/etcetc

CSS and everything else loads fine. Obviously the images load fine on the host computer, however I’m looking to setup so can work from LAN based machines too.

Read More

I figure htaccess would be a simple(ish) fix, if I at all knew what I was doing.

Basically could anyone point me in the direction of a htaccess code to directed localhost to 10.0.1.2 please?

Thanks!

Related posts

Leave a Reply

2 comments

  1. The question you are asking is not the correct one – you do not want to change localhost to point to a specific private IP address or you will have issues with an unknown number of other things.

    To properly correct the issue you will need to go through the process of Moving WordPress – updating the URLs in the options, postmeta, and posts tables. This can also be achieved by exporting the contents of your site to an XML file, doing a search and replace on this text document (change localhost to 10.0.1.2 or whatever host name you want), and then re-uploading it. You will need to update the site_url and wp_home values as well.

  2. Follow the steps:

    1. Go to Dashboard > Settings > General
    2. In the ‘WordPress Address (URL)’ and ‘Site Address (URL)’ labeled text boxes replace the word ‘localhost’ with your IP address.
    3. Save changes.

    This solves your problem.