0
蔭試圖從RedirectMatch htaccess的不工作
重定向我的網頁從http://domain.com/article.php?id=23232 到http://domain.com/article/23232
我在.htaccess中使用此語法
所以請什麼這是錯誤嗎?
蔭試圖從RedirectMatch htaccess的不工作
重定向我的網頁從http://domain.com/article.php?id=23232 到http://domain.com/article/23232
我在.htaccess中使用此語法
所以請什麼這是錯誤嗎?
你不能匹配查詢字符串使用RedirectMatch
。使用mod_rewrite
規則改爲:
RewriteCond %{QUERY_STRING} ^id=([^&]*)
RewriteRule ^article\.php$ http://domain.com/article/%1? [L,R=301,NC]
謝謝先生,不過這只是重定向到http://domain.com/article沒有采取ID – user3178889
很抱歉,錯字的錯誤,現予以更正它。請再試一次。 – anubhava
@ user3178889:這是否適合你? – anubhava