Hi,
On my site www. translating-it. eu which runs on classic asp on an iis 7.5 with url rewrite mod I work with redirects/rewrites to get user friendly urls. The rewrite rule works great (web.config file looks like this) :
<rule name="RewriteUserFriendlyURL2" stopProcessing="true"><match url="^([^/]+)/?$" /><conditions><add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /><add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /></conditions><action type="Rewrite" url="{R:2}.asp?l={R:1}" /></rule>
the outbound does too:
<rule name="OutboundRewriteUserFriendlyURL2" preCondition="ResponseIsHtml1"><match filterByTags="A, Form, Img" pattern="^(.*/)(.*)\.asp\?l=([^=&]+)$" /><action type="Rewrite" value="{R:1}{R:3}/{R:2}" /></rule>
but the redirect rule causes a problem and I get page not found all the time.
<rule name="RedirectUserFriendlyURL2" stopProcessing="true"><match url="^(.*)\.asp\?l=(.*)" /><conditions><add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /><add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /></conditions><action type="Redirect" url="{C:1}/{R:2}/{R:1}" appendQueryString="false" /></rule>
after the domain normal url is /index.asp?l=lu which should become domain/lu/index and of course the other way round.
index can have other names too (e.g. impressum, agb, translations ...) and lu can be other too (e.g. de, en, fr ...)
Can anyone help me with that problem?
thx in advance,
Pascal