Reputation: 41
We have a number of websites that have now been closed down and deleted however are still indexed in Google, even though they are returning a 404.
I want to set http 410 for everything on the domain, how would I do this in the htaccess? Use wildcards?
Upvotes: 4
Views: 1808
Reputation: 785038
I want to set http 410 for everything on the domain
You can use this rule as your first rule in your DOCUMENT_ROOT/.htaccess
file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
RewriteRule ^ - [L,R=410]
Don't forget to replace domain.com
with your actual domain name.
Upvotes: 5