Question

i see that Google in error has indexed thousands of urls that are not in the sitemap.xml.

These urls probably are considered as duplicate content (according to Google only).

I would need to deindex them fairly quickly. So would a 410 gone or a 404 not found status would be more handy.

in htaccess i would like to redirect anything with after the domain name .com/?

 www.domain.com/?KKId=xxx
 www.domain.com/?bid=xx
 www.domain.com/?page=xxxx

could we also get these url's to redirect as above, with 410 gone status

www.domain.com/page.php?bid=1&page=xxx
www.domain.com/page.php?bid=2&page=xxx
www.domain.com/page.php?bid=3&page=xxx
www.domain.com/page.php?bid=5&page=xxx
www.domain.com/page.php?bid=6&page=xxx
www.domain.com/page.php?bid=7&page=xxx
www.domain.com/page.php?bid=8&page=xxx
www.domain.com/page.php?bid=9&page=xxx

to this page

www.domain.com/page.php?bid=4&page=xxx
Was it helpful?

Solution

You can try adding these rules to the htaccess file in your document root, ideally above any other rules you may already have there:

RewriteEngine On
RewriteCond %{HTTP_HOST} \.com$ [NC]
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^$ - [L,R=410]

You can replace the R=410 with a R=404 if you'd rather have a "Not Found" response.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top