Caipiranha
Caipiranha

Reputation: 55

301 from mobile=N in htaccess

I wanted to make a 301 from URL with ?mobile=N parameter to URL without that parameter. Google is indexing this URL and I think that 301 is the best way to fix that

eg.

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

Upvotes: 0

Views: 25

Answers (1)

Croises
Croises

Reputation: 18671

You can use in your .htaccess:

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

Upvotes: 1

Related Questions