Multi-Language and Content-Negotiation for Mirror

AskApache Intro and Mirror Update

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi guys,

I just made some fixes to the mirrors I run at:

 http://tor.askapache.com/
 http://tor.askapache.com/dist/

This is the .htaccess file that I came up with, note I painstakingly
determined the languages..  (In the future it would be great to get each
corresponding charset for the AddCharset directive)

Note I also added compression for basic text/ plain/ type files and
added some simple Cache-Control through the mod_expires module.

#######################################################################
Options FollowSymLinks Indexes MultiViews
Order allow,deny
Allow from all
SetEnv SERVER_ADMIN webmaster@xxxxxxxxxxxxx
SetEnv TZ America/California
DirectoryIndex index

# German (de)
# English (en)
# Spanish (es)
# Farsi (fa)
# Suomi (fi)
# French (fr)
# Italian (it)
# Japanese (ja)
# Korean (ko)
# Dutch (nl)
# Norwegian (no)
# Russian (ru)
# Portugese (pt)
# Polish (pl)
# Svenska (se)
# Turkish (tr)
# Simplified Chinese (zh-CN)

AddLanguage de .de
AddLanguage en .en
AddLanguage es .es
AddLanguage fa .fa
AddLanguage fi .fi
AddLanguage fr .fr
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ko .ko
AddLanguage nl .nl
AddLanguage no .no
AddLanguage pl .pl
AddLanguage pt .pt
AddLanguage ru .ru
AddLanguage se .se
AddLanguage tr .tr
AddLanguage zh-CN .zh-cn

# TODO: Get all the charsets for each lang
AddCharset ISO-8859-1 .iso8859-1 .nl .se
AddCharset UTF-8 .utf8

AddDefaultCharset UTF-8
DefaultType text/html
DefaultLanguage en

LanguagePriority en de es fr ja ko pt-br ru tr
ForceLanguagePriority Prefer Fallback

AddType text/html .tr
RemoveHandler .pl

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css
AddOutputFilterByType DEFLATE text/xml application/javascript
</IfModule>

<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault M3600
</IfModule>

- --
AskApache

- -- 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJKZ908AAoJEMrKIrNtw6tfP60IALHBKMC8m+8WZ3cSKX2hySjH
xy4HcAmKcXHv0pyBayuh8v0QBLAMD/cLSnF1/NYdP2kWm5C2S2UPdF/lIykG3cvi
TtvKQ1jY0LGDLKm5b5DsS1goqm33ogmGxueyKJPb3j5lhQighAaPUniW5n3kp3P9
vstwl5zHfCEGi4NUPRjDkIbGHHO+fw+A1P6G/J8/T1XFrsFb6wMus6KZZUEGLoGU
39WwFQocq0qopXf/1eQEpE/BQHVO/nezlyhfxWLy21BGKwaFgF/0p1+xkCcuBqlq
py/LBVbDsRXnBnHZ+cDBRDuN68IamX1Ba56apuU4mb/stpXU6XwwsMSSmBGi+NM=
=F8dX
-----END PGP SIGNATURE-----
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s