Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set 410 for entire website?

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?

like image 758
Daniel Ashburn Avatar asked Sep 14 '25 08:09

Daniel Ashburn


1 Answers

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.

like image 73
anubhava Avatar answered Sep 16 '25 08:09

anubhava