Problems favicon.ico I get two request!

1

I have tried to find the solution to this problem in several forums, but I do not see anything concrete.

I use the framwork Codeigniter PHP (I have the version 2.1.0 of Codeigniter) and every time my application loads a page, for example:

http://ejemplo.com/site/principal

In the Apache access_log it is observed.

/ejemplo.com/site/principal
/ejemplo.com/site/principal/favicon.ico

When there is a request to a controller, the finished call is always duplicated by the favicon.ico. Having this additional call that processes all the framwork or there is error or problems.

I've seen out there that they talk about specifying the favicon.ico with for example:

<link rel="icon" href="favicon.ico" type="image/x-icon" />

Or similar, I have tried all the options and I have the favicon.ico in the root that loads it correctly, however the two answers continue.

As a preventive form in the file routes.php of codeigniter I have put this code:

$pos_track = strpos($_SERVER['REQUEST_URI'], "favicon.ico");

if ($pos_track !== false) {
    header ("Location: ".RUTA_WWW."/favicon.ico");
    exit;
}

In this way, any request that has favicon.ico and passes through the framwork goes to favicon.ico of the root.

But let's see if anyone knows why this happens and some finer way, if any, to solve it.

Example:

link

additionally in the apache log there is also a call to http://miweb.com/site/id/favicon.ico , in any controller, despite having a favicon.ico file in the root and loading correctly.

I tried to put:

<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="short icon" href="favicon.ico" type="image/x-icon" />

Even with a codeigniter helper, but nothing calls twice.

Thank you all for your answers.

I'm referring to Apache's access_log. When there is a request to a controller, the finished call is always duplicated the favicon.ico.

Example:

link

Well this is processed correctly, call the site controller and pass a paramenter. But additionally in the apache log there is also a call to

link , in any driver, despite having a favicon.ico file in the root and loading correctly .

Having this additional call that processes all the framwork or there is an error or problems.

I tried to put:

Even with a codeigniter helper, but nothing calls twice.

I have the version 2.1.0 of Codeigniter, which is a little old, I know, however this problem does not seem to make much sense.

Thanks again.

Greetings.

    
asked by Blueopenland 19.01.2018 в 17:52
source

0 answers