Home How to match German Umlaut (uppercase Ü) in htaccess rewrite-rules?
Reply: 1

How to match German Umlaut (uppercase Ü) in htaccess rewrite-rules?

Frank Nocke
1#
Frank Nocke Published in 2018-01-08 14:43:02Z

I have a vanity-url redirect as a rewrite rule in .htaccess, including German Umlaut ü (Umlaut in the path, no Umlaut-Domain with those double-dashes...):

RewriteRule ^(uber|ueber|über|%C3%BCber|%C3%9Cber)([_-]mich)?\/?$ 
    https://somewhere-else.com [NC,R=301]

Remarkably, it works for: mydomain.com/uber..., ueber-me, also lowercase mydomain.com/über does work.

The only thing not working is übercase mydomain.com/Über. Though I did verify the correctness of my URI-encodings with rishida... %C3%BCber %C3%9Cber? it should be.

Confusing…

Frank Nocke
2#
Frank Nocke Reply to 2018-01-08 14:48:41Z

Aye, that was easy:

Any ü and Ü comes in unencoded (in my case, might differ between clients…), however: Option NC does not bother about case-neutral matching for non-standard characters, thus I have to explicitly match both variants, upper and lowercase ü:

RewriteRule ^(uber|ueber|über|Über| <-- NEW ... 

(still leaving the encoded ones for Overzealousness. Not taking bets other clients won't URI-encode… :o)

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.317502 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO