Reputation: 11
I'm facing an issue after migrating my blog from Blogger to Wordpress.
My all old links are properly redirecting to WP but there are few 404
errors in my Google Webmaster Tools account.
For example: www.bloggertipstricks.com/2013/03/seo-tips.html?m=1
There is an extra parameter added after the URL (?m=1). Anybody please help me to resolve this issue.
Upvotes: 1
Views: 293
Reputation: 1304
Here I got solution for this. As you know that Blogger also ends with ?m=0
with ?m=1
so you have to remove both from URLs. So try the below codes by adding them in the top of .htaccess
file...
You you can use the following code in any version:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^m=1$
RewriteRule ^(.*)$ /$1? [R=301,L]
RewriteCond %{QUERY_STRING} ^m=0$
RewriteRule ^(.*)$ /$0? [R=301,L]
In Apache 2.4 and above you can use the following:
RewriteCond %{QUERY_STRING} m=[01]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [QSD,R=301,L]
In lower version of Apache then 2.4 you can use the following:
RewriteCond %{QUERY_STRING} m=[01]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI}? [R=301,L]
Upvotes: 1