newbie trying to write url rewrite in .htaccess file
My site was under e开发者_JAVA百科xample.com/waha/
.
Now I move the site right under the root example.com
.
I want to 301 redirect all the old links like example.com/waha/notice/5803
to example.com/notice/5803
.
How can I do it?
My current .htaccess file is below.
<IfModule mod_rewrite.c>
RewriteEngine On
# NOTE: change this to your actual StatusNet path; may be "/".
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?p=$1 [QSA,L]
</IfModule>
<FilesMatch "\.(ini)">
Order allow,deny
</FilesMatch>
Options -Indexes
Try this rule in front of your other mod_rewrite rule:
RewriteRule ^waha/(.*) /$1 [L,R=301]
精彩评论