2012-07-11 66 views
0

我正在使用的模板是在URL的末尾(根據用戶的文本大小首選項)生成與?fontstyle = f-smaller或?fontstyle = f-smaller的鏈接。現在這造成明顯的重複內容問題。我禁用了該功能,但網址仍處於投放狀態。如何使用.htaccess在URL末尾刪除?fontstyle = f-smaller?

我想使用.htaccess從我的網址去除這些。例如: http://www.mysite.com/article?fontstyle=f-smaller 會重定向到 http://www.mysite.com/article

我在這裏和它在其他地方搜查,但我只找到如何刪除片段。我想要的一個細分市場的變化,我不知道該怎麼做。

在此先感謝

回答

2

嘗試

RewriteEngine On 

RewriteCond %{QUERY_STRING} ^(.*)(^|&)fontstyle=f-smaller(.*)$ 
RewriteRule ^(.*)$ /$1?%1%3 [R=301,L] 
+0

它完美非常感謝你! – user1516468 2012-07-11 04:22:39