我想要我的网址
http://gpuzzles.com/quiz/small-ridldes/
重定向到
http://gpuzzles.com/quiz/small-riddles/
但它不起作用
我的.htacess文件位于测验文件夹中
RewriteEngine On
RewriteBase /quiz/
Redirect 301 /quiz/small-ridldes/ /quiz/small-riddles/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)?$ index.php?url=$1&page=$2 [L,QSA]
我想要什么
quiz/small-ridldes/ redirects to
quiz/small-riddles/ redirects to // ----- not working
index.php // ----working
答案 0 :(得分:2)
您不希望将mod_alias指令(Redirect
)与mod_rewrite指令(RewriteRule
)混合使用。尝试:
RewriteEngine On
RewriteBase /quiz/
RewriteRule ^small-ridldes/$ /quiz/small-riddles/ [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)?$ index.php?url=$1&page=$2 [L,QSA]