Forum Moderators: phranque
RewriteCond %{HTTP_USER_AGENT} ^Foo
RewriteCond %{REQUEST_URI} ^/file
RewriteRule .* - [G]
Is there any equivalent to [G] for a 404? Or another possibility? (file needs to remain on server) How risky is it to give a 410 for HTTP 1.0 requests?
Regards
Don't return a 410 to an HTTP/1.0 client -- The client won't know what to do with it, because 410 wasn't defined until HTTP/1.1. That said, some clients which advertise as HTTP/1.0 are actually HTTP/1.1 compatible. One example is GoogleBot. The easiest way to determine a true HTTP/1.0 client is that it will not provide a Host header in the HTTP request; Just test HTTP_HOST, and if blank, use HTTP/1.0 protocol:
# Respond with 410-Gone to HTTP/1.1 requests for removed resources, else let them 404
RewriteCond %{HTTP_HOST} .
RewriteCond %{REQUEST_URI} ^/(announce¦mat¦sp_event¦whatsnew¦weather)\.html$ [OR]
RewriteCond %{REQUEST_URI} ^/(contact/¦poll4-99/)
RewriteRule .* - [G]