Jump to content

modrewrite and server log query


ProblemHelpPlease

Recommended Posts

I have a modrewrite running in a htaccess file for my site which is converting address from www.domain.com/afile.php to www.domain.com/afile etc.It all works perfectly however I am receiving several error messages in the error log for the server sayingdomain.com [Tue Jul 20 12:05:33 2010] [error] [client **.**.***.***] File does not exist: /home/sites/domain.com/public_html/afileThis is not happening on all visitors to the site, just some, and not on any particular page its quite random.Is this something to be concerned about, are some visitors to the site having a problem viewing the site, and if so how do I fix it.UPDATE: I have just noticed that the favicon was not using a full path which was possibly causing the error. Thanks

Link to comment
Share on other sites

If your rewrite rule is adding .php to all file requests, then image files, css files, javascript files, etc. will all have an extra .php appended to them if your rule is not specific enough. For example:

RewriteRule ^example.com/(.*)$ /example.com/$1.php

would be a poor rule and would cause problems.

Link to comment
Share on other sites

The rules are in the formats below

RewriteRule ^(afile)$ index.php?menu_page=$1RewriteRule ^(afile)/$ index.php?menu_page=$1RewriteRule ^(afile.php)$ index.php?menu_page=afileRewriteRule ^(afile.php)/$ index.php?menu_page=afile

They pass varaibles to several other functions before displaying content. It seems to be about 1 in every 100 visitors that has an issue, I wondered if a bot might be viewing things differently.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...