I'm working with an intranet system that, on each page, checks the user's cookie, verifies that they can see the current page based on database permissions,开发者_如何学Go and records a page hit that includes their id and the page URL.
I just noticed that in the pagehits table, I see an entry for 404.php (my custom 404 page specified in the Apache config) one second after each legitimate page hit.
Is this probably my fault, or does it have something to do with how Apache decides to load the 404 page?
I'm using Apache 2.2.14 (Win32) and PHP 5.3.2.
My guess would be that you have no favicon.ico defined for your site.
That means that every time a user requests a page, the browser is also requesting favicon.ico which results in a 404 being returned.
You probably have a request for a file which doesn't exist. Maybe your favicon. The Apache error or access logs will reveal what the 404 was for.
Try reading your logs and see which url trigger the 404 response code. Also you can install some log analyzer like awstats
精彩评论