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?%252525253Bid_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]
CodePudding user response:
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]