.htaccessutf-8internationalizationidn

Redirect to URL with umlauts or accents via .htaccess


To redirect to a new URL that contains diacritics via .htaccess, what is the correct and safe way?

For context, the following page on internationalized domain names (IDN) has a section about the technical solution to include accents and umlauts in domains.


Solution

  • In the domain part, you must use ASCII Compatible Encoding (ACE). In the rest of the URL, you use urlencode. So, in .htaccess…

    http://www.bücher.ch/schöne/

    …needs to be written as…

    http://www.xn--bcher-kva.ch/sch%C3%B6ne/