HTTP的当量=英寸×UA兼容"内容=" IE =边缘,镀铬= 1" ......在.htaccess把这个? [英] http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" ... Putting this in .htaccess?

查看:249
本文介绍了HTTP的当量=英寸×UA兼容"内容=" IE =边缘,镀铬= 1" ......在.htaccess把这个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了HTML5的样板和下,很快与这验证了头。

 < META HTTP-当量=X-UA-Compatible的内容=IE =边缘,镀铬= 1>
 

有人告诉我,我可以添加此为.htaccess相同的效果,以避免验证错误。

 < IfModule mod_headers.c>
  头集合X-UA-Compatible的IE =边缘,镀铬= 1
  #mod_headers中无法通过内容类型匹配,但我们不希望发送这个头在*一切* ...
  < 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)$" >
    头取消设置的X UA兼容
  < / FilesMatch>
< / IfModule>
 

我的问题是

  1. 如何测试,以确保这是正常工作
  2. 什么是filesmatch参数呢?我应该被修改或者是pretty的好,是?
解决方案

试图通过在web.config或htacess文件,通过它

Web.config中

 < httpProtocol>
  < customHeaders>
    <清/>
    <添加名称=X-UA-Compatible的价值=IE =边缘,镀铬= 1/>
  < / customHeaders>
< / httpProtocol>
 

你的页面会后有效。很抱歉,我不是一个PHP的人。

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

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

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>

My question is

  1. How do i test to make sure this is working properly
  2. What does the filesmatch parameter do? should i be modifying that or is that pretty good as-is?

解决方案

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>

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

这篇关于HTTP的当量=英寸×UA兼容&QUOT;内容=&QUOT; IE =边缘,镀铬= 1&QUOT; ......在.htaccess把这个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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