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.

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


where I change `` by my IP address.