2
0
Fork 0
mirror of https://github.com/phanan/htaccess.git synced 2018-11-08 13:39:40 +01:00

Add Auto UTF-8 encode

This commit is contained in:
An Phan 2015-02-01 12:27:27 +08:00
parent c6711a5986
commit 937cb0daec

View file

@ -30,6 +30,7 @@ A collection of useful .htaccess, all in one place. I decided to create this rep
- [Custom Error Pages](#custom-error-pages)
- [Force Downloading](#force-downloading)
- [Allow Cross-Domain Fonts](#allow-cross-domain-fonts)
- [Auto UTF-8 Encode](#auto-utf-8-encode)
## Rewrite and Redirection
Note: It is assumed that you have `mod_rewrite` installed and enabled.
@ -304,4 +305,15 @@ CDN-served webfonts might not work in Firefox or IE due to [CORS](https://en.wik
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
```
```
### Auto UTF-8 Encode
Your text content should always be UTF-8 encoded, no?
``` apacheconf
# Use UTF-8 encoding for anything served text/plain or text/html
AddDefaultCharset utf-8
# Force UTF-8 for a number of file formats
AddCharset utf-8 .atom .css .js .json .rss .vtt .xml
```
[Source](http://h5bp.com)