nethnet Posted November 25, 2009 Share Posted November 25, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/182867-403-forbidden-returned-instead-of-404-not-found/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.