0

I have problems with getting my IIS URL Rewrite 2 rules to work with non-English (Swedish) characters (å ä ö). I'm on Windows Server 2012 R2 (IIS 8.5).

This rule works well with English characters:

<rule name="RedirectSubWebKeepURI" enabled="true" stopProcessing="true">    
    <match url="^department/lawyers/(.*)" />
    <action type="Redirect" url="/section/lawyers/{R:1}" />
</rule>

But assume I would spell "lawyers" as "låwyers" (not a real word!), how can I get it to work?

Neither of the examples below work:

<match url="^department/låwyers/(.*)" />          [real character]
<match url="^department/l%C3%A5wyers/(.*)" />     [URL encoded 'å']

What am I missing? This previous question says you have to use the {UNENCODED_URL} variable, but does that mean I have to match all URL:s with ".*" and move the actual matching logic to a condition instead? If so, I can't really figure out how my rule should be rewritten accordingly...

Thanks for help!

greycloud
  • 191
  • 1
  • 2

1 Answers1

0

Try using internal UrlEncode{} like this:

<action type="Redirect" url="/section/lawyers/{UrlEncode:{R:1}}" />
Roman Svitukha
  • 1,302
  • 1
  • 12
  • 22
  • Thanks. But will this really help when the problematic character is in the URL text "lawyers" (for example as "låwyers"), i.e. outside {UrlEncode:{R:1}}? `` – greycloud Sep 10 '18 at 07:21