R
R
Raegdan2013-03-11 15:37:00
Apache HTTP Server
Raegdan, 2013-03-11 15:37:00

Apache 2 HTTP code change from 403 to 404

Hey Habr. I can’t find it in search engines (perhaps because I don’t know how to formulate the request correctly?), so I’ll ask here. How can I get Apache 2 to return a 404 to the client when it encounters a 403 error? This is not an error page - I know how to deal with it - but an HTTP code to completely disguise a 403 as a 404. Thanks in advance!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Meliborn, 2013-03-11
@Meliborn

The first thing that comes to mind:

ErrorDocument 403 http://адрес_страницы_которая_точно_вернет_404

V
Vitaly Arkhipov, 2013-03-11
@arvitaly

httpd.apache.org/docs/2.2/mod/mod_headers.html
Generally for changing any headers

U
UZER2006, 2013-03-11
@UZER2006

RewriteRule ^.*$ - [R=404,L]
Now I thought that I might be wrong, but this is how I did the web access restriction and masking under 404.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question