Jump to content

Recommended Posts

Basically, pretty much every error encountered on my web server is a 403 - Forbidden error, even when the file does not exist and 404 - Not Found should be returned.  It's crucial that the correct error code is returned, so that our automated debugging schema can notify us properly on the error.  We don't want to be told 1,000 times a day that people are having trouble accessing a forbidden file when it doesn't even exist in the first place.

 

The false errors started to be encountered after a .htaccess update involving a new mod_rewrite schematic.  I'll post the entire relevant portion of the .htaccess file that was altered so that perhaps the source of the error can be found.  Is there something wrong with the mod_rewrite that is causing a Forbidden error instead of Not Found?

 

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

** lines edited to omit sensitive material**

Options -Multiviews
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^home$ index.php [L]
RewriteRule ^login$ register
RewriteRule ^game/([0-9]+)/?$ game.php?id=$1 [L]
RewriteRule ^error/([0-9]{3})/?$ error.php?code=$1 [L]
RewriteRule ^user/([A-Za-z0-9]{4,14})/?$ user.php?name=$1 [L]
RewriteRule ^stats/?$ /stats/index.php [L]
RewriteRule ^([A-Za-z0-9]+)/?$ $1.php [L]

ErrorDocument 404 /error/404
ErrorDocument 500 /error/500
ErrorDocument 403 /error/403

 

Is there something obvious that I'm missing here?

Link to comment
https://forums.phpfreaks.com/topic/184546-wrong-error-codes-returned/
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.