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

Asked

Viewed 798 times

0

I ran W3C HTML Validator to check for any problems 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 didn’t even have any headers compatible with X-UA. 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; changed the settings of . htaccess 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.

  • Hello John, the answer helped you, there is some doubt about her?

1 answer

2

The message:

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

If translated says something like:

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

Meaning this may not have been in your .htaccess or .php, and yes in the HTML part, you must be using something similar to this:

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

However the Chormeframe was discontinued in 2014, according to the official link: https://www.chromium.org/developers/how-tos/chrome-frame-getting-started

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

That is, the chrome=1 it is no longer necessary, just use the IE=edge, then 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 either using php and/or htaccess yourself, look in all your files. php for something like this:

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

and trade for this:

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

If you have in your . htaccess something similar:

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

or

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

And remove the ,chrome=1:

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

or

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

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

  • So, @Guilherme Nascimento, the worst is that I’m not using this meta tag. Actually, I’m not using anything that contains the string ",Chrome=1". Is this coming from the server? Thank you

  • @Joãomarcos sends the link to the page you are trying to validate

  • here you are: https://peasc.educative.com.br/

  • @Joãomarcos The problem is a header, https://i.stack.Imgur.com/e2noj.png, also see that I edited the question, follow the tips that should solve the problem ;)

  • Dude, I swear to you there’s no ",Chrome=1" in any of my files. Before I saw this mistake, I didn’t even know this "XUA" existed. Must be the server q is serving my site with this header, why didn’t I put.

  • @Joãomarcos I believe :) ... So you don’t have any other . htaccess in another folder? You use Apache or Ngnix?

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.