UTF-8 in Apache
TODO: Looking at the broken charsets on my website, this article
needs work...
HowTo enable the recommended charset, utf-8, in Apache web server.
This will make all international characters, including Finish ones.
Write your XHTML pages as described in the XHTML-chapter, then
apply the settings specific to your Apache version. If you
have plain text (.txt) pages, they automatically work
when Apache is configured as below.
XHTML
The officially recommended way in w3c HTML Compatibility Guidelines
Unicode rocks
= = =
Apache 2.0
Apache 2.0 is included in redhat 8.0 and redhat 9.0. To enable utf-8,
change the public_html directory description in httpd.conf. Add
FileInfo to AllowOverride. You have propably done that allready.
There is no need to remove any other configuration from directory
description.
AllowOverride FileInfo
After editing, apply changes by restarting Apache
/etc/init.d/httpd restart
After that, any user can add a .htaccess file to his $HOME/public_html
AddCharset UTF-8 .html .htm .txt
You can try browsing to a page to check if you get the correct charset,
and if special characters are displayed correctly.
To see what server really sends you
curl -s -i http://www.hut.fi/~tkarvine/ |less
= = =
Apache 1.3
Used in the www.hut.fi website. Add this .htaccess to your $HOME/public_html
AddDefaultCharset UTF-8
(c)2003 Tero Karvinen atta iki fi
All rights reserved