httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tanner Bachman <>
Subject [users@httpd] Handling Error Codes
Date Wed, 16 Sep 2009 15:22:52 GMT
Hi Everyone, 

This is my first post to this list, so I apologize if this question has already been addressed.

I am currently running Apache 2.2.9 on a Windows XP SP3 box (development machine). I have
a certain directory that appears in all of my virtual hosts as part of the backend servlet
engine. I have added the following to my Apache httpd.conf file: 

<Location /some/directory> 
Order deny,allow 
Deny from all 
Allow from 

This works perfectly to prevent any public users from accessing that directory on my site.
However, when I visit that directory on the site, I get an Error 403 (Forbidden). Obviously,
this gives away the fact that that directory even exists. As such, I would also like to take
a kind of "Security by Obscurity" approach by forwarding all Error 403 requests to Error 404.
If possible, I would like to avoid messing with mod_rewrite and really don't want to create
custom error pages for every error...although I will if that's the best solution. So, is there
some kind of code that I can use that will just forward those requests to another error template?


<Location /some/directory> 
Order deny,allow 
Deny from all 
Allow from 
ErrorDocument 403 some code to forward it to ErrorDocument 404 

Any help will be much appreciated! :-) 



View raw message