http-equiv="X-UA-Compatible";内容=“IE=边缘,铬=1";... 把它放在 .htaccess 中? [英] http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" ... Putting this in .htaccess?

查看:28
本文介绍了http-equiv="X-UA-Compatible";内容=“IE=边缘,铬=1";... 把它放在 .htaccess 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了 html5 样板文件,但它不会在标题中使用此内容进行验证.

I downloaded html5 boilerplate and it wouldnt validate with this in the header.

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

有人告诉我,我可以将它添加到 .htaccess 中以获得相同的效果以避免验证错误.

I was told I can add this to .htaccess for the same effect to avoid validation errors.

<IfModule mod_headers.c>
  Header set X-UA-Compatible "IE=Edge,chrome=1"
  # mod_headers can't match by content-type, but we don't want to send this header on *everything*...
  <FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|xpi|safariextz|vcf)$" >
    Header unset X-UA-Compatible
  </FilesMatch>
</IfModule>

我的问题是

  1. 我如何测试以确保它正常工作
  2. filesmatch 参数有什么作用?我应该修改它还是原样很好?

推荐答案

尝试通过 web.config 或 htacess 文件传递​​

Try to pass it through the web.config or htacess file

Web.Config

<httpProtocol>
  <customHeaders>
    <clear />
    <add name="X-UA-Compatible" value="IE=Edge,chrome=1" />
  </customHeaders>
</httpProtocol>

您的页面将在此之后有效.对不起,我不是一个 php 人.

your page will be valid after that. Sorry I am not a php guy.

这篇关于http-equiv="X-UA-Compatible";内容=“IE=边缘,铬=1";... 把它放在 .htaccess 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆