Apache Indexes Chinese directory garbled solution

  
                  

Recently I plan to build a cyberspace to share resources and want to use FTP, but I don’t think it’s good. So just use Apache's Indexes parameter to build a virtual host that can browse the directory. The advantage is that it can be displayed directly in the browser as a web page.

But there is a problem with the configuration of the Apache documentation. After testing, if the directory contains Chinese files or Chinese directories, it will display garbled characters in IE, so check its encoding in the browser and find that it uses ISO-8859-1 encoding by default. After manually selecting GB2312, it will display normally. It seems that the encoding of Apache Indexes when processing Chinese is incorrect.

Carefully study the documentation, which shows that you can specify a specific encoding for Indexes in the Apache configuration file. We can modify the configuration file to support Chinese. The specific method is as follows:

Add in the configuration file:

IndexOptions Charset=GB2312

This will solve the Chinese garbled problem of the Apache autoindex module.

Copyright © Windows knowledge All Rights Reserved