How to move WordPress without breaking web links

WordPress allows you to specify your blog url as, for example, It also allows you to run the blog from the base of your domain, e.g. For the longest time, I didn’t mess around with this because I didn’t see it as a big deal.

Not long ago, I upgraded linux hosting to Windows deluxe hosting at There were so many issues with WordPress under windows (see my previous post). On top of that, performance had never been exactly what I’d expect, and a lot of constraints were blocking me from being productive. So, I switched to

The problem is that I have years of links to my site in the format:

and I now wanted it in the format:

I went about this by following WordPress’s guide to giving wordpress its own directory. This went well, then I had to update the .htaccess file to allow /site/wp-admin yet remove /site from all other links.

# BEGIN WordPress

RewriteEngine On
RewriteBase /site
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /site/index.php [L]

RewriteRule ^/site/wp-admin(.*)$ /site/wp-admin/$1 [L]

# END WordPress

Related Articles