简体   繁体   中英

Why do I have a page hit for 404.php after each legitimate pagehit?

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM