4

I am trying to redirect requests from a umlaut domain to another domain.

My following code works with ANY other domain, but not umlaut:

<IfModule mod_rewrite.c>
  RewriteCond %{HTTPS} !=on
  RewriteCond %{HTTP_HOST} ^(www\.)?frankfurter-flöhe\.de/$ [NC]
  RewriteRule ^ http://kinderkultur-frankfurt.de/frankfurter-floehe-theaterprogramm.html [R=301,L]
</IfModule>

However, when I call the umlaut domain and then copy it from Google Chrome's address bar, I get this:

http://xn--frankfurter-flhe-zwb.de/

Although, if I use that obfuscated domain in my htaccess file instead of the "real" umlaut domain, it doesn't work either.

Does anybody have an idea how to match that domain?

MrWhite
  • 13,315

3 Answers3

1

Try using the NE flag, to prevent mod_rewrite from encoding the URL. For more information about NE: http://httpd.apache.org/docs/current/rewrite/flags.html#flag_ne

<IfModule mod_rewrite.c>
  RewriteCond %{HTTPS} !=on
  RewriteCond %{HTTP_HOST} ^(www\.)?frankfurter-flöhe\.de/$ [NC,NE]
  RewriteRule ^ http://kinderkultur-frankfurt.de/frankfurter-floehe-theaterprogramm.html [R=301,L]
</IfModule>

If this doesn't work, try to use the HEX equivalent of umlaut, as suggested in: https://stackoverflow.com/questions/11107375/umlauts-in-htaccess-redirects

Kao
  • 207
0

The UTF-8 URL with Umlaut needs to be converted into ACE encoding (ASCII Compatible Encoding).

You can use the following online tool to convert an international domain with Umlauts.

www.frankfurter-flöhe.de becomes xn--frankfurter-flhe-zwb.de and this is what needs to be used in the htaccess redirect.

0

Did you try with :

RewriteEngine On
RewriteCond %{HTTP_HOST} ^frankfurter-flöhe.de$ [OR]
RewriteCond %{HTTP_HOST} ^www.frankfurter-flöhe.de$
RewriteRule (.*)$ http://kinderkultur-frankfurt.de/frankfurter-floehe-theaterprogramm.html [R=301,L]