Note that there are some explanatory texts on larger screens.

plurals
  1. POURL Rewrite Issue
    primarykey
    data
    text
    <p>I have a webserver that hosts several .NET websites. The way I've set it up is so the root of the server contains a folder for each site that contains the content for it. I then have a web.config in the root directory that handles the URLs and points the user to the proper folder depending on what site they were going to.</p> <p>Root directory:</p> <ul> <li>\SiteA</li> <li>\SiteB</li> <li>\web.config</li> </ul> <p>And here is what the web.config looks like this:</p> <pre><code>&lt;configuration&gt; &lt;system.webServer&gt; &lt;rewrite&gt; &lt;rules&gt; &lt;clear /&gt; &lt;rule name="SiteA" enabled="true" stopProcessing="true"&gt; &lt;match url="(.*)" /&gt; &lt;conditions logicalGrouping="MatchAll" trackAllCaptures="false"&gt; &lt;add input="{HTTP_HOST}" pattern="^(www\.)?.siteAdomain\.com$" /&gt; &lt;/conditions&gt; &lt;action type="Rewrite" url="\SiteA\{R:0}" /&gt; &lt;/rule&gt; &lt;rule name="SiteB" enabled="true" stopProcessing="true"&gt; &lt;match url="(.*)" /&gt; &lt;conditions logicalGrouping="MatchAll" trackAllCaptures="false"&gt; &lt;add input="{HTTP_HOST}" pattern="^(www\.)?.siteBdomain\.com$" /&gt; &lt;/conditions&gt; &lt;action type="Rewrite" url="\SiteB\{R:0}" /&gt; &lt;/rule&gt; &lt;/rules&gt; &lt;/rewrite&gt; &lt;urlCompression doStaticCompression="true" doDynamicCompression="true" /&gt; &lt;/system.webServer&gt; &lt;/configuration&gt; </code></pre> <p>SiteA is also using ASP.NET Membership:</p> <pre><code>&lt;authentication mode="Forms"&gt; &lt;forms name=".ASPXFORMSAUTH" loginUrl="~/account/login.aspx" /&gt; &lt;/authentication&gt; </code></pre> <p>The issue is that when I go to SiteA, authentication kicks in and I am redirected to the loginUrl. However, it is resolving the path with respect to the root folder and not the SiteA folder, which is causing a 404.</p> <p>After looking into it, <a href="http://www.iis.net/learn/extensions/url-rewrite-module/url-rewriting-for-aspnet-web-forms#Using_tilda" rel="nofollow">this site</a> mentions this was a bug that was patched with .NET 3.5 SP1. However, my hosting service is on .NET 4.X running IIS 8.0 so I think I should be all clear of this.</p> <p>Am I missing something easy here?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload