tags:

views:

19

answers:

1

Hi,

There exists a blog at domain.com

I wish to do a 301 redirect on anything that is after domain.com/[category/[post-name] to domain.com/blog/[category]/[post-name]

The key here is when someone hits domain.com they just stay there. Only if there's any reference to posts within domain.com that I wish for the redirect to work.

Will hold this for at most 6 months, until SEO settles, and then remove the redirect.

What is the best way of achieving this with .htaccess ?

The current one is as follows:

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

Any help is appreciated.

Thank you.

A: 
RewriteRule /(\w+)/([^/]+)  /blog/$1/$2 [R=301,L]
Amarghosh