Changing WordPress Blog Domain Name and URL

Not sure if the average reader would notice this, but the domain name and URL has changed of the blog. Don’t worry, all the old links will still copy over to the exact posts with the new domain.

So here’s the change:
http://www.josephhannigan.com/blog2
is now
http://www.hanniganblog.com/blog

Update your links – www.joeandjamie.com

This is something that always has bugged me since day one. I don’t know what took me so long to do this, would have been much faster if I had done it when I had three posts and a small database.

Over the next week you may experience different looks of the blog. I will be testing some new themes. Quite frankly I have grown board with this one. I did put a lot of work into making it what it is though, I remember all the long nights tweaking the page code.

Since this was a bit of a daunting task (more me worrying about screwing it up more than anything), I want to share the articles I found that were very helpful.

http://codex.wordpress.org/Moving_WordPress -This article is hands down the most important. It is narrowed down to each specific type of move you could be doing. Whether you are changing subdirectories or servers, this is the document for you.

http://codex.wordpress.org/Changing_The_Site_URL – This article goes deeper with the database changes to be made. I found it just as easy to backup the database, edit it in a good text editor (not notepad) to update the links, then restore it.

http://codex.wordpress.org/Backing_Up_Your_Database

http://codex.wordpress.org/Restoring_Your_Database_From_Backup
The trickiest part was figuring out how not to lose the old links. I am sure most will drop from the search engines, but I do have a handful of direct links which I didn’t want to lose. I found documents on .htaccess redirect rules which did the trick. The following site from Apache has all the mod aliases you can use. The RedirectMatch worked best for me.

http://httpd.apache.org/docs/2.0/mod/mod_alias.html

This is the code that I have in my old blog’s folder .htaccess file.

RedirectMatch 301 ^/blog2/(.*)$ http://www.hanniganblog.com/blog/$1

This keeps everything after www.joeandjamie.com/blog/ and puts it after www.joeandjamie.com/blog/ essentially pointing all old links to the new URLs, which is exactly what I wanted! I couldn’t be any happier.

Another important step was getting the image URLs updated. This wasn’t done during any other step because they are part of the content in the post. I very luckily stumbled across a wonderful plugin to take care of this for me.

http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/ – This plugin allows you to enter the old URL and the new one and presto-magico its done…I wish everything were that simple…

I learned a bunch of neat stuff tonight. Feel free to ask any questions and I’ll try my best to help.

2 thoughts to “Changing WordPress Blog Domain Name and URL”

Comments are closed.