Reputation: 11055
I write some rewrite rule to manipulate the first folder after domain address as a query string indicating the language.
<rule name="en">
<match url="^en/(.*?/)" />
<action type="Rewrite" url="./{R:1}/?lang=en" />
</rule>
The code above works for first step folders:
http://example.com/en/members
Executes:
http://example.com/members/?lang=en
but not or second and deeper steps.
http://example.com/en/members/profile/
Executes:
http://example.com/members/?lang=en
and the second step folder (profile) is being ignored.
Upvotes: 0
Views: 53
Reputation: 5205
Your first rule shouldn't work either, because the parameter ^en/(.*?/)
doesn't match en/members
, but you can try this rule:
<rule name="en">
<match url="^en/([^/]+)" />
<action type="Rewrite" url="http://example.com/{R:1}/?lang=en" />
</rule>
Upvotes: 1