2

My searches have turned up blank... I'm trying to change the 403 Forbidden status of the response to a 404 Not Found status with this line:

Header set Status-Line "HTTP/1.1 404" "expr=%{REQUEST_STATUS} == 403"

However, this is having no effect. I suspect it might be because there actually isn't a Status-Line header used by Apache, although it is part of the HTTP spec. So is this even possible? I'm trying to get this done with a Header directive rather than rewriting, as it seems the better way to do it.

0

The Header directive can only be used to set HTTP headers. I'm afraid the first line of the repsonse from an HTTP request is not actually an HTTP header and so cannot me modified as such.

A possible way to do this (not tested) is to do something like:

ErrorDocument 403 /cgi-bin/my-forbidden.cgi

And have that CGI set a 404 return code along with the text you wish to show.

Otherwise you'd need write your own handler in mod_{perl|lua|etc}.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.