Error "X-UA-Compatible HTTP header must have the value IE = edge, was IE = Edge, chrome = 1"

0

I ran the W3C HTML Validator to check if there was a problem and this is the only error I have: //prntscr.com/gj1z22

  

"X-UA-Compatible HTTP header must have the value IE = edge, was IE = Edge, chrome = 1"

I did not even have any X-UA compatible header. After I found this error, I did my research: 1 , 2 , //www.sitepoint.com/community/t/how-to-solve-http-equiv-validation-error-from-w3c-validator/178466; I changed the .htaccess settings and even put some PHP code in my headers to display the correct meta tag, as recommended in this forum, but still, the error continues

PHP Header:

if (isset($_SERVER['HTTP_USER_AGENT']) && 
    (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))
        header('X-UA-Compatible: IE=edge');

.htaccess:

<FilesMatch "\.(htm|html|php)$">
    <IfModule mod_headers.c>
        BrowserMatch MSIE ie
        Header set X-UA-Compatible "IE=Edge" env=ie
    </IfModule>
</FilesMatch>

Why is this happening? I note that I did not have any such header the first time I received this message. All the solutions I found in this forum did not work.

    
asked by anonymous 11.09.2017 / 16:04

1 answer

2

The message:

  

X-UA-Compatible HTTP header must have the value IE = edge, was IE = Edge, chrome = 1

If translated it says something like:

  

The X-UA-Compatible HTTP header should contain the value "IE = edge", but "IE = Edge, chrome = 1" was found

In other words, this may not have been in your .htaccess or .php , but in the HTML part, you should be using something similar to this:

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

However, Chormeframe was discontinued in 2014, according to the official link: link

  

Google Chrome Frame is no longer supported and retired as of February 25, 2014.

That is, chrome=1 is no longer required , just use IE=edge , so HTML should look like this:

<meta http-equiv="X-UA-Compatible" content="IE=edge">

However if your HTML is correct then this means that you are using php and / or htaccess yourself, look in all your .php files for something like this:

header('X-UA-Compatible: IE=Edge,chrome=1');

and switch to this:

header('X-UA-Compatible: IE=Edge');

If you have something similar in your .htaccess:

Header set X-UA-Compatible "IE=Edge,chrome=1"

or

Header add X-UA-Compatible "IE=Edge,chrome=1"

And remove ,chrome=1 :

Header set X-UA-Compatible "IE=Edge"

or

Header add X-UA-Compatible "IE=Edge"
  

Note: You do not need to use header('X-UA-Compatible: IE=edge'); or Header set X-UA-Compatible "IE=Edge" env=ie along with <meta> , to summarize, or you use .htaccess, or you use header() or you uses <meta> , the 3 at the same time is redundancy.

    
11.09.2017 / 17:38