2015-10-23 45 views
0

我想從一個帶有?mobile = N參數的URL創建一個301到沒有該參數的URL。谷歌正在索引這個網址,我認爲301是最好的方法來解決這個問題。301 from mobile = N in htaccess

FROM

www.example.com/?mobile=N

TO

www.example.com

FROM

www.example.com/example/ example.com?mobile=N

TO

www.example.com/example/example.com

+2

的可能的複製[htaccess的重定向301](http://stackoverflow.com/questions/ 2041525/htaccess-redirect-301) –

回答

1

您可以使用您的.htaccess

RewriteEngine on 
RewriteCond %{QUERY_STRING} ^mobile=N$ [NC] 
RewriteRule^%{REQUEST_URI}? [R=301,L] 
+1

很好,謝謝Croises! – Caipiranha

+0

不客氣,很高興它解決了。 – Croises