我正在使用IIS7。当用户登录时,一切都很顺利。但是如果我注销并转到:
dev.local/EN/Login.aspx
URL重写就无法正常工作了。首先,它会重定向到
dev.local/Login.aspx?ReturnUrl=/EN/Login.aspx
为什么?如何在重定向之前使URL重写起作用?
web.config:
<system.web>
<authentication mode="Forms">
<forms name=".MyForm" loginUrl="Login.aspx" domain="dev.local" cookieless="UseCookies" protection="All" path="/" timeout="30" />
</authentication>
</system.web>
<system.webServer>
<rewrite>
<rules>
<rule name="LanguageUrlRewrite">
<match url="^(.+)/(es|en|fr|pt)/(.+)?(.+)" />
<action type="Rewrite" url="{R:1}/{R:3}?Language={R:2}&{R:4}" />
</rule>
</rules>
</rewrite>
</system.webServer>