Apache 配置默认编码

找到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");
?>

 

转载于:https://www.cnblogs.com/cloudshadow/p/apache_default_code.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值