2011-12-28 33 views
0

這裏是我的Apache重寫規則:沒有查詢字符串的Apache重定向?

RewriteCond %{QUERY_STRING} cate_id\=(\d+) 
RewriteRule ^cate.php$ category-%1-b0.html [R=301,L] 

我想重定向cate.php cate_id = 72類別的72 b0.html,但它重定向到類-72-B0? .html?cate_2 = 72,我不希望在.html之後查詢字符串,是否有無論如何刪除它?

回答

2

嘗試:

RewriteRule ^cate.php/.*$ category-%1-b0.html? [R=301,L] 
+0

它的工作原理!謝謝你,你真好~~~ – missingcat92 2011-12-28 06:35:12

1

試試這個: 「?」 請注意在RewriteRule的末尾。

RewriteEngine On 
RewriteCond %{QUERY_STRING} cate_id\=(\d+) 
RewriteRule ^cate.php$ category-%1-b0.html? [R=301,L]