views:

24

answers:

1

I'm helping someone with a Wordpress blog which at one time was at

http://example.com/example/

Now they've move the blog to the root of the site and want to redirect any of the old links to the correct site.

Wordpress has it's own re-write rules in .htaccess already:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

I'm assuming I need to add an additional RewriteRule line above the previous one. I tried adding:

RewriteRule ^example(.*) /(.*) [R=301, QSA]

But that doesn't seem to do it.

A: 

Try this rule and put it before the other:

RewriteRule ^example($|/(.*)) /$2 [L,R=301]
Gumbo
I had to add it above the RewriteCond lines, but that did it. Thanks!
ddysart