2010-03-10 116 views
0

那裏domain.com的.htaccess重寫,但所有域本身的子目錄

存在一個博客,我希望做301重定向的任何事情是後domain.com/[category/[post-name]domain.com/blog/[category]/[post-name]

這裏的關鍵是,當有人打到domain.com他們只是呆在那裏。只有在domain.com內有任何提及我希望重定向起作用的帖子時。

將持續這最多6個月,直到SEO安定,然後刪除重定向。

用.htaccess實現這個最好的方法是什麼?

當前一個如下:

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

任何幫助理解。

謝謝。

回答

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