Forum Moderators: phranque
Q2:
I also need to tell the spiders that other individual files in the main directory have been removed or renamed, and that they should stop searching for them. For instance, "regsave2.html" has been renamed to "regsave.html" for about 6 months, but every now and then I see a SE looking for the old file.
Thanks in advance
The info is spread around in the documentation, so here's an example. This will respond to requests for several obsolete html and php files with a 410-Gone if the request is HTTP/1.1 or above. Otherwise, the server's default 404 handler will be invoked.
# Respond with 410-Gone status to HTTP/1.1+ requests for removed resources.
# HTTP/1.0 requests will "fall through" and invoke default server 404 handling.
RewriteCond %{THE_REQUEST} ^[^\ ]+\ [^\ ]+\ HTTP/(1\.[1-9]¦[2-9]\.[0-9])
RewriteCond %{REQUEST_URI} ^/(edsel¦victrola¦icebox¦bellbottoms)\.html$ [OR]
RewriteCond %{REQUEST_URI} ^/(corvair¦pinto)\.php$
RewriteRule .* - [G]
Ref: Introduction to mod_rewrite [webmasterworld.com]
Jim