HTTP Header and Metadata - an English version sample

MIME and Charset

In order to specify your document's language, the server is expected to add a charset= parameter to its Content-Type field of the response header. If you use an Apache server, include next line in your httpd.conf or .htaccess file:

[Example] AddType "text/html; charset=Shift_JIS" .html

With this configuration, a file with .html extension will be returned with 'Shift_JIS' charset information in its Content-Type header field.

SSI and Last-Modified

SSI (Server Side Include) is very poweful tool to manage a large site by including common bannar in all files. However, the server won't return Last-Modified field for files which use SSI.

If you want to include Last-Modified header in your SSI files, add next line to your configuration file,

[Example]XBitHack full

and set Exec permission to ON for those SSI files.

Content Negotiation

HTTP/1.1 defines content negotiation mechanism so that agent and server can cooperate to retrieve the best preferred resource. Apache server provides MultiViews function to take advantage of this content negotiation quite easily.

Add next line to your configuration file to activate MultiViews.

[Example]Options +MultiViews

Then, you'll map file extensions to language codes with following directives.

[Example]

AddLanguage ja .ja
AddLanguage en .en

Now, files with .ja extension are associated with Japanese veison, and .en with English counterparts. Prepare each version's file with appropriate extension:

[Example]

http-header.html.ja
http-header.html.en

When Apache receives a request for http-header.html, it will check Accept-Language header, and will return appripriate version.

The Accept-Language header of your browser will be set via [Option/Language Preference] configuration.