I want to 410 all urls with .html extension.
say xx.html, yy.html (all with .html).
How do I acheive that with htacess Rewrite or redirect 410 rules?
I want to 410 all urls with .html extension.
say xx.html, yy.html (all with .html).
How do I acheive that with htacess Rewrite or redirect 410 rules?
HTTP status 410
means "Gone", which can be accomplished by the [G]
flag in mod_rewrite.
RewriteRule \.html$ - [G]
See documentation for the G flag and the documentation for mod_rewrite.
Just add this single line to your .htaccess file
RedirectMatch gone "/*\.html$"
Done, this is auto http header status to 410