MV

Friday, May 25, 2012

Switch IP addresses for WordPress

As technical writer, I should be playing with all kinds of tools, so since WordPress is becoming more and more popular, I'd give it a try.

So I installed WordPress on a LAMP stack (as a virtual machine), by following their Famous 5-Minute Install instructions. So all went fine. I used the IP address of my VM to configure my WP database since I don't have a domain name. No problem, I played a bit around with WordPress, tested some configurations, and so on. It really works fine.

Unfortunately after restarting my VM, I got another IP address and I was no longer able to connect to my installation. Not in FireFox, not in Chrome. In FF I got to an login window, but in plain text, so no CSS at all. But the most surprising was that both browsers always tried to reach WordPress via my previous IP address.

After clearing the cache and cookies of my browsers and restarting Apache on my WordPress server I thought my issue would be solved... wishful thinking that was.

Luckily I can trust my dear friend Google. One search query and following the first result got me back in the driving seat.

http://stackoverflow.com/questions/535534/wordpress-host-ip-changed

I only need to change the wp-config.php file and add these two lines:


define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

where I change `example.com` by my IP address.

2 comments:

  1. Thanks, I've been having a hard time with this this morning - i'm still having issues with the domain name loading but at least I can now access the site via the IP!

    ReplyDelete
  2. DreamHost is ultimately the best web-hosting provider for any hosting services you might require.

    ReplyDelete