Tuesday, December 30, 2008

apache的目录索引(index)的编码问题

平时为了方便, 一般都是如下配置一个文件夹的索引:

alias /devres "/uss/www/doc.rdev/devres/"

Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all



现在有一个问题, 就是apache默认把这种行为设置为iso-8859-1

如下为得到的信息(使用dog程序):

HTTP/1.1 301 Moved Permanently
Date: Wed, 31 Dec 2008 01:42:44 GMT
Server: Apache/2.2.8 (FreeBSD) mod_ssl/2.2.8 OpenSSL/0.9.8e DAV/2 SVN/1.4.6
Location: http://doc.rdev.kingsoft.net/share/media/
Content-Length: 249
Connection: close
Content-Type: text/html; charset=iso-8859-1

为了使apache在进行index时使用UTF-8编码, 增加下面的选项:
IndexOptions Charset=UTF-8

OK! 工作完成!

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.