I experimented a bit with <rewrite>
tag and got it to work when I changed the url to match the wrong path "Account/Login
":
<system.webServer>
<rewrite>
<rules>
<rule name="Unauthorized access" stopProcessing="true">
<match url="Account/Login" />
<action type="Redirect" url="/Login.aspx"/>
</rule>
</rules>
</rewrite>
</system.webServer>
Now it's not only redirecting to "Login.aspx
" but it also has the original query string: Login.aspx?ReturnUrl=%2fManagerPages%2fVideoManager.aspx