Apache HTTP IDN config

Strickly speaking there is no difference if you are mapping a domain name in standard latin or IDN. Apache, nor DNS do not care about what you write in your domain name. They use what is referred to as PunyCode, which basically a way to transfer your local name to a latin character name.

These transformed names start with xn-- and look something like: xn--b1agh1afp.com.ua

And that is exactly what you need to specify in the apache virtual host config.

For example:

        ServerName xn--b1agh1afp.com.ua 
        DocumentRoot /var/www/html/privet.com.ua/
                Options FollowSymLinks
                AllowOverride None
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        ServerAlias *.xn--b1agh1afp.com.ua
        AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
        AddType application/x-httpd-php-source .phps
        AddDefaultCharset utf-8
        DirectoryIndex index.html index.php

NOTE: When I first tried this I though I might be doing something wrong because I used Firefox to check it, but this is a Firefox issue, so do not worry - it is the correct way of doing this.

This page was last updated on: 26/07/2013 12:39