2016-07-29 22 views
0

的.htaccess我想從入門到appeneded URL發行使用301重定向使用參數

問題與的.htaccess停止參數我的網站說example.com

1:我有重定向

example.com/deatils.php?366%2520WORDS%2520IN%2520MUMBAI example.com/bookshelf/366_words_in_mumbai

我寫了下面的代碼

RewriteRule ^deatils.php?366%2520WORDS%2520IN%2520MUMBAI example.com/bookshelf/366_words_in_mumbai [R=301,L] 

但開口 example.com/deatils.php?366%2520WORDS%2520IN%2520MUMBAI

重定向到example.com/bookshelf/366_words_in_mumbai?366%252520WORDS%252520IN%252520MUMBAI

我「?」後不要字符串將被追加

回答

0

在你的htaccess中使用這個額外的規則重定向,它會爲你工作。

RewriteCond %{QUERY_STRING} (^|&)366%2520WORDS%2520IN%2520MUMBAI($|&) 
RewriteRule ^deatils\.php$ /bookshelf/366_words_in_mumbai? [L,R=301]