Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can map domains or subdomains to an MVC2 Area easily using the IIS7 URL Rewrite module. Here are two simple rules that map subdomains to two Areas. I added a restriction to not use this rule if the request is for an actual file (i.e. CSS, JS, or image files).</p> <p>Here is the sample config that goes right in your web.config:</p> <pre><code>&lt;system.webServer&gt; &lt;rewrite&gt; &lt;rules&gt; &lt;rule name="SubA Area"&gt; &lt;match url=".*" /&gt; &lt;action type="Rewrite" url="/SubA/{R:0}" /&gt; &lt;conditions&gt; &lt;add input="{HTTP_HOST}" pattern="suba.mydomain.com" /&gt; &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&gt; &lt;/conditions&gt; &lt;/rule&gt; &lt;rule name="SubB Area"&gt; &lt;match url=".*" /&gt; &lt;conditions&gt; &lt;add input="{HTTP_HOST}" pattern="subb.mydomain.com" /&gt; &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&gt; &lt;/conditions&gt; &lt;action type="Rewrite" url="/SubB/{R:0}" /&gt; &lt;/rule&gt; &lt;/rules&gt; &lt;/rewrite&gt; &lt;/system.webServer&gt; </code></pre> <p>You'll have to change the rules below to work with your particular use case. Especially if you have controllers on the root area that you need to use. In that case, just add a condition or create a new rule.</p> <p>Download the IIS URL Rewrite module (required): <a href="http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/" rel="noreferrer">http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/</a></p>
    singulars
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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