Jump to content

German htaccess question "Umlaut" domains


mr-fan
 Share

Recommended Posts

Like title says i've some domains with umlauts öäüß and i'd like to redirect them to the non umlaut version

example:

http://my-domän.de to http://my-domaein.de

i've somethings like this in my htacess:

##redirect umlautdomain (not my domain)
RewriteCond %{HTTP_HOST} ^xn--mhldorf-nsb.d$ [NC]
RewriteRule ^(.*)$ http://muehldorf.de//$1 [R=301,L]

in my config.php i only have muehldorf.de in my hosts list...

is there something that i've misunderstood? so far it doesn't work....but may the htaccess rules take some time to exicute...i tried since about an hour some different rules.

regards mr-fan

Link to comment
Share on other sites

If the two domains point to the same server and document root, then you should probably just do a wildcard redirect.

Or, even better, make it redirect if the non-IDN is not being accessed (seeing as it's the only domain in your hosts array):

RewriteCond %{HTTP_HOST} !muehldorf\.de$ [NC]
RewriteRule ^ http://muehldorf.de%{REQUEST_URI} [R=302,L]

I'd recommend that you make this one of the first condition/rule sets, just under RewriteEngine On.

  • Like 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...