site is called twice?

后端 未结 5 375
后悔当初
后悔当初 2020-12-12 05:13

My Problem is, that my php site is called twice. But i don\'t know why. in my access-log i also get two entries if i reload:

127.0.0.12 - - [13/Oct/2010:20:4         


        
5条回答
  •  旧巷少年郎
    2020-12-12 05:50

    this is one of Chrome's known quirks. It re-requests favicon.ico on every single page call (even view source!) Other browsers cache it. Nothing you need to be concerned about. Just make sure the file is there to avoid the 404 overhead! - by @chigley

    UPDATE

    after thinking about the 404 issue i found an other resolution.

    add this line into your .htaccess file:

    RewriteCond %{REQUEST_URI} !^/favicon\.ico [NC] 
    

    OLD and DEPRECATED

    hm to be able to accept an answer in this thread... I found a rather easy way to not react on that request ... but it is for testreason only

    I just put this in the first php line of my index file:

    if($_SERVER['REQUEST_URI'] == "/favicon.ico") return false;
    

    even if the favicon.ico is there this will help you avoid double entries in your error-log files. it makes it much more readable then.


    you have to know that i am using a .htaccess file like this:

    Options +FollowSymLinks
    IndexIgnore */*
    # Turn on the RewriteEngine
    RewriteEngine On
    RewriteBase /
    #  Rules
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/favicon\.ico [NC] 
    RewriteRule . index.php
    

提交回复
热议问题