How to change login redirect location if loginUrl is relative?
<p>If <code>loginurl</code> property of Forms Authentication is relative - <code>~/...</code>, it's added to route of current page when timeout redirect is processed. How to use another route in this case?</p>

<p>For example: <br></p>

<p>loginUrl property: <code>~/registration/login.aspx</code></p>

<p>current url: <code>site.com/main/dir/page.aspx</code></p>

<p>and when redirect is processed, <code>site.com/main/dir/registration/login.aspx</code> url is generated and it's wrong. </p>

<p>I want to get <code>site.com/main/registration/login.aspx</code> but now I can't.</p>

<p>My <code>web.config</code> contains next lines</p>

<pre><code>&lt;authentication mode="Forms"&gt;
  &lt;forms loginUrl="~/registration/login.aspx" timeout="120" enableCrossAppRedirects="true" /&gt;
&lt;/authentication&gt;
</code></pre>