Results 1 to 3 of 3

Thread: Apache2 virtual hosts foreign characters

  1. #1
    Join Date
    Sep 2009
    Beans
    6

    Apache2 virtual hosts foreign characters

    Hello!

    I've run into some problems when I'm trying to add a virtual host with a foreign character in the domain name.
    The foreign character is ö.

    I've read earlier threads where it was said I should puny code it, which then translates to xn--nda

    I then created a virtual host, as shown (replaced the real domain with examplö:
    Code:
    <VirtualHost *:80>    
        ServerAdmin me@examplö.com
        ServerName examplö.com
        ServerAlias examplxn-nda.com
        
        DocumentRoot /var/www/examplo
        <Directory /var/www/examplo>
            Options Indexes FollowSymLinks
            AllowOverride All 
            Order allow,deny
            allow from all
        </Directory>
    
        ErrorLog /var/log/apache2/examplo_error.log
        LogLevel warn
        CustomLog /var/log/apache2/examplo_access.log combined
    
    </VirtualHost>
    However, apache2 doesn't recognize this when I try to enter the domain, it just shows my 000default.

    Any help is appreciated!

  2. #2
    Join Date
    Dec 2006
    Location
    Chicago
    Beans
    3,839

    Re: Apache2 virtual hosts foreign characters

    Punycode is not simple substition.

    ö = xn--nda
    examplö.com != examplxn-nda.com
    examplö.com = xn--exampl-1xa.com

    http://mct.verisign-grs.com/
    http://en.wikipedia.org/wiki/Punycod...ding_procedure

  3. #3
    Join Date
    Sep 2009
    Beans
    6

    Re: Apache2 virtual hosts foreign characters

    Thanks, that cleared things up.

    Anyway, what I read earlier was wrong too.
    The ServerName should contain the punycoded string, while the alias is the regular one.

    Code:
    <VirtualHost *:80>    
        ServerAdmin me@examplö.com
        ServerName xn--exampl-1xa.com
        ServerAlias examplö.com
        
        DocumentRoot /var/www/examplo
        <Directory /var/www/examplo>
            Options Indexes FollowSymLinks
            AllowOverride All 
            Order allow,deny
            allow from all
        </Directory>
    
        ErrorLog /var/log/apache2/examplo_error.log
        LogLevel warn
        CustomLog /var/log/apache2/examplo_access.log combined
    </VirtualHost>

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •