Jump to content

403 Forbidden returned instead of 404 Not Found


nethnet

Recommended Posts

Hi, I'm having some issues with my web server in terms of 4xx errors.  I've tried Googling this issue for a couple days now, but all I can seem to find is the exact opposite of my problem.

 

I've recently implemented a complex mod_rewrite system on my Apache server to keep attackers from having access to the directory structure (or even knowing the structure for that matter).  I've also implemented an automatic error schematic that notifies the administrators with a log of all Apache error codes received.  In theory, this was supposed to reduce the stress for us in debugging broken links, etc, but it has created a bit more of a problem.

 

An error 403 Forbidden code seems to be returned when a 404 Not Found would be appropriate.  The mod_rewrite schema implemented reroutes URI's as such:

 

/user/example/blog/test rewritten from user.php?id=example&method=blog&methodid=test

 

And so forth.  The base redirect is as such

 

/anything rewritten from /anything.php (this is, of course, with exception of some critical directories that are not rewritten, such as /images, /css, /js, /inc, etc.)

 

It is crucial that we have an error 404 Not found code returned when /anything is accessed and /anything.php doesn't actually exist.  I'm assuming the server confusion revolves around the fact that no default index.php file exists in the /anything directory (thus returning Forbidden) but with the rewrite it shouldn't be trying to access this directory in the first place.

 

Is there a way to force an error 404 instead of a 403?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.