当前位置首页 > Apache知识

Apache配置默认编码

阅读次数:259 次  来源:admin  发布时间:

找到apache配置文件 httpd.conf ,找到以下内容

#
# Specify a default charset for all content served; this enables
# interpretation of all content as UTF-8 by default.  To use the
# default browser choice (ISO-8859-1), or to allow the META tags
# in HTML content to override this choice, comment out this
# directive:
#
AddDefaultCharset UTF-8

实践效果:windows下的配置文件没有这些内容,手动添加也没有效果 温馨提示:尽可能使用 脚本(如:PHP)来定义编码,代码如下:

<?php
header("Content-type: text/html; charset=utf-8");
?>
上一篇:IIS7.0运行MVC3出现401错误的解决方案
下一篇:Nginx配置与使用-奇天异下