Céd*_*vin 7 iis iis-7 http-headers encoding
我尝试使用 IIS 7 强制编码。
当我在 http 响应头中添加密钥时:
内容类型和值 charset=utf-8 我得到了这个关键的内容类型:text/html,content-type=utf-8
有没有办法去掉逗号?
感谢贾斯汀的回答。
但它看到不起作用。有我的配置,我需要为 asp 经典做那个。
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".html" />
<remove fileExtension=".hxt" />
<remove fileExtension=".htm" />
<remove fileExtension=".asp" />
<mimeMap fileExtension=".htm" mimeType="text/html" />
<mimeMap fileExtension=".hxt" mimeType="text/html" />
<mimeMap fileExtension=".html" mimeType="text/html" />
<mimeMap fileExtension=".asp" mimeType="text/html; charset=UTF-8" />
</staticContent>
</system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)
您可以在 web.config 文件中为每个需要的网站手动设置特定文件扩展名的内容类型。在站点的根目录中,找到 web.config 文件并添加如下所示的remove和mimeMap行(或创建整个文件,如果它尚不存在)。
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".html" />
<mimeMap fileExtension=".html" mimeType="text/html; charset=UTF-8" />
</staticContent>
</system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)
从解决这个问题的IIS 论坛上的讨论中获取的示例。
| 归档时间: |
|
| 查看次数: |
14623 次 |
| 最近记录: |