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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.