Support » Fixing WordPress » Redirect problem after migrating wordpress from root to subdirectory

  • I migrated my wordpress blog from my root domain ( to a subdirectory ( Everything seems to be working fine, so I wanted to setup an .htaccess redirect at the root so that anyone who had bookmarked a specific post at the old URL ( will be directed to the new URL ( instead of getting a 404 error.

    The wrench in this whole thing is that I want to still have a basic (non wordpress) page at the old root address, and I can’t seem to figure out how to write a regular expression for the .htaccess file that forwards all the old posts, but ignores requests to go to the root.

    Here is what I am working with in the .htaccess file:

    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST}$ [NC]
    RewriteCond %{HTTP_HOST} !blog
    RewriteRule ^(.*)$$1 [R=301,L]

    This works great to redirect all the old posts to the new location, however when you type in it directs to, as you would expect. I am trying to figure out a way to write an exclusion of some sort that ignores requests to go specifically to only.

    I’ve been banging my head against a wall for a while because this regular expression stuff is over my head, but I have a feeling that this might be pretty straight forward for someone who does this often. Any ideas?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Redirect problem after migrating wordpress from root to subdirectory’ is closed to new replies.