Moving WordPress To A Different Directory

April 10th, 2006

This web site was originally created and maintained using CityDesk from Fog Creek Software. CityDesk is a great tool for the job, but it only runs on Windows and I’ve moved to the Mac, so maintaining the site was becoming a pain.

I was looking for a server-based content management system, and WordPress was the most suitable one I could find for my needs. It’s not perfect, but it’s easy, convenient, and very good. And it’s free.

When I set WordPress up, I installed it into the /dacollins/ subdirectory (i.e. This was a convenient way to spend time tailoring things, setting up my templates and plugins, importing content, etc without impacting my main site. All the changes were confined to a single subdirectory, and it wasn’t publicised much so I didn’t have to worry about breaking links as I played around and reorganised things.

Finally, after 2 or 3 months of on-again-off-again tinkering, I got everything just how I wanted it and was ready to copy WordPress to my site’s root (i.e.

The WordPress web site has some good instructions detailing how to move your site, and it worked exactly as advertised for me. The only thing I added was a line in .htaccess to redirect requests for the /dacollins/ subdirectory to the root directory – so if someone clicked on their bookmark for, they’d be automatically redirected to instead of encountering a 404 error. Click on the links to see how it works.

Assuming you’ve got mod_rewrite turned on, the line to add to .htaccess is:

RewriteRule ^dacollins/(.*)$ $1 [L,redirect=permanent]

This basically just strips the ‘dacollins/’ out of the URL.

I’ve left all the original CityDesk files where they were. You can still see pages from the old web site here for example. This makes sure that any pages that were indexed by search engines or linked to by other sites are still online, but new visitors will only see the new site.

Entry Filed under: Web,WordPress



April 2006
« Mar   May »

Most Recent Posts