Apache 410 Gone instructions not working with mod_alias nor mod_rewrite
Posted
by
Peter Boughton
on Server Fault
See other posts from Server Fault
or by Peter Boughton
Published on 2012-11-03T03:40:17Z
Indexed on
2012/11/03
23:04 UTC
Read the original article
Hit count: 295
Apache 2.2 seems to be ignoring instructions to return a 410 status.
This happens for both mod_alias's Redirect (using 410
or gone
) and mod_rewrite's RewriteRule (using [G]
), being used inside a .htaccess file.
This works:
Redirect 302 /somewhere /gone
But this doesn't:
Redirect 410 /somewhere
That line is ignored (as if it had been commented) and the request falls through to other rules (which direct it to an unrelated generic error handling script).
Similarly, trying to use a RewriteRule with a [G] flag doesn't work, but the same rule rewriting to a script that generates a 410 does - so the rules aren't the problem and it seems instead to be something about 410/gone that isn't behaving.
I can workaround it by having a script sending the 410, but that's annoying and I don't get why it's not working.
Any ideas?
© Server Fault or respective owner