Reputation: 23
I've been trying to 410 a pattern of a few thousands toxics URLS that got indexed by Google for one of my clients. I want every urls of the website that contain ?%
to send a 410 response code so they got de-indexed.
Example of an URL :
https://www.example.com/fr/promotions?%25252525253Bid_lang=6&p=6
I've tried to put this in the .htaccess
, above the If module section, as I found on another thread here, but it didn't work, any ideas ?
RewriteRule ^[a-z]shop($|/) - [G]
Upvotes: 2
Views: 172
Reputation: 45829
I want every urls of the website that contain ?% to send a 410 response code
Using mod_rewrite at the top of the .htaccess
file:
# Send 410 for any URL where the query string starts with "%"
RewriteCond %{QUERY_STRING} ^%
RewriteRule ^ - [G]
Upvotes: 3