Note that there are some explanatory texts on larger screens.

plurals
  1. PONeed help figuring out this rewrite rule
    primarykey
    data
    text
    <p>Here is my web.config</p> <p>I have Primary domains like www.web1.com and www.web2.com (www is optional) that need to rewrite to sub1.mainsite.com and sub2.mainsite.com and also have www.mainsite.com active.</p> <p>I have been trying many different configurations and I have not come up with anything usable.</p> <p>In the trace it is weird because it shows the input as blank so Matched is false.</p> <p>If anyone can shed some light on this, it would be greatly appreciated.</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;configuration&gt; &lt;system.webServer&gt; &lt;rewrite&gt; &lt;rules&gt; &lt;clear /&gt; &lt;rule name="Alegent Rewrite" enabled="true" stopProcessing="true"&gt; &lt;match url="^(www.)?web1\.com(.*)" ignoreCase="true" /&gt; &lt;conditions logicalGrouping="MatchAny" trackAllCaptures="false"&gt; &lt;/conditions&gt; &lt;action type="Rewrite" url="https://sub1.thesite.com/{R:2}" logRewrittenUrl="true" /&gt; &lt;/rule&gt; &lt;rule name="Prairie Health" stopProcessing="true"&gt; &lt;match url="^www\.web2\.com(.*)" ignoreCase="true" /&gt; &lt;conditions logicalGrouping="MatchAny" trackAllCaptures="false"&gt; &lt;add input="{HTTP_HOST}" pattern="^web2.com$" /&gt; &lt;add input="{HTTP_HOST}" pattern="^www.web2.com$" /&gt; &lt;/conditions&gt; &lt;action type="Rewrite" url="https://sub2.thesite.com/{R:1}" logRewrittenUrl="true" /&gt; &lt;/rule&gt; &lt;rule name="noextension" enabled="true" patternSyntax="ECMAScript" stopProcessing="true"&gt; &lt;match url="^(.*)$" /&gt; &lt;conditions logicalGrouping="MatchAll" trackAllCaptures="false"&gt; &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /&gt; &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&gt; &lt;/conditions&gt; &lt;action type="Rewrite" url="{R:1}.cfm" logRewrittenUrl="true" /&gt; &lt;/rule&gt; &lt;/rewrite&gt; &lt;defaultDocument&gt; &lt;files&gt; &lt;remove value="default.aspx" /&gt; &lt;remove value="iisstart.htm" /&gt; &lt;remove value="Default.asp" /&gt; &lt;remove value="Default.htm" /&gt; &lt;/files&gt; &lt;/defaultDocument&gt; &lt;tracing&gt; &lt;traceFailedRequests&gt; &lt;remove path="*" /&gt; &lt;add path="*"&gt; &lt;traceAreas&gt; &lt;add provider="WWW Server" areas="Rewrite" verbosity="Verbose" /&gt; &lt;/traceAreas&gt; &lt;failureDefinitions statusCodes="200-399" /&gt; &lt;/add&gt; &lt;/traceFailedRequests&gt; &lt;/tracing&gt; &lt;/system.webServer&gt; &lt;/configuration&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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