The Apache web site sets the language encoding for a specific directory __ encoding

Source: Internet
Author: User
Tags html header
The network has a lot of learning materials in the form of web pages, collected very practical, but a lot of information in different language coding, there are GB2312, BIG5, UTF-8, and so on, some in the relevant page marked with the language code is OK, if there is no mark, web customers open the appropriate page, The browser may return a heap of garbled characters to the user. The Apache configuration file provides a addcharsetdefautl parameter for the server to return the page to the customer in the defined language encoding. In the Apache configuration file httpd.conf File New directory options, to Addcharsetdefaut command, you can achieve: example:/var/www/html/big5_study directory data are traditional code of information, and the relevant page of the HTML header does not define the page encoding, and the majority of the server page for gb2312, in order to reduce the browser manually change the page code of the trouble, you can add the following line after Httpd.con:

<directory "/var/www/html/big5_study" >
Addcharsetdefault Big5
</Directory>

Save, restart the Web service, the customer can easily access that directory of traditional code data

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.