views:

62

answers:

3

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, 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.

+8  A: 

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.

Justin Niessner
+5  A: 

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.

Yann Ramin
+1  A: 

Try reading your logs and see which url trigger the 404 response code. Also you can install some log analyzer like awstats

Pablo Viojo