How can I redirect everything but the index as 410?
- by Mikko Saari
Our site shut down and we need to give a 410 redirect to the users. We have a small one-page replacement site set up in the same domain and a custom 410 error page. We'd like to have it so that all page views are responded with 410 and redirected to the error page, except for the front page, which should point to the new index.html.
Here's what in the .htaccess:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule !^index\.html$ index.html [L,R=410]
This works, except for one thing: If I type the domain name, I get the 410 page.
With www.example.com/index.html I see the index page as I should, but just www.example.com gets 410. How could I fix this?