Url rewriting 通过web.config重写url的通配符重定向
我正在使用web.config中的url重写功能重定向我的子域。这是我的规则:Url rewriting 通过web.config重写url的通配符重定向,url-rewriting,web-config,Url Rewriting,Web Config,我正在使用web.config中的url重写功能重定向我的子域。这是我的规则: <rule name="redirect_page"> <match url=".*" ignoreCase="false" negate="false" /> <conditions> <add input="{HTTP_HOST}" pattern="^www\." negate="true" /> &l
<rule name="redirect_page">
<match url=".*" ignoreCase="false" negate="false" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www\." negate="true" />
<add input="{HTTP_HOST}" pattern="^([\w\-]+)\.mySite\.com$" />
</conditions>
<action type="Rewrite" url="profile.aspx?name={C:1}" />
</rule>
重定向到
但是
重定向到
=>我想要什么:
重定向到
有什么想法吗?这有点棘手,但解决办法如下:
<rule name="SubDomainDoNothing" stopProcessing="true">
<match url="(.+)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(?!www)(\w+)\.plugandtable\.com$" />
</conditions>
<action type="Rewrite" url="{R:1}" />
</rule>
<rule name="SubDomainRedirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(?!www)(\w+)\.plugandtable\.com$" />
</conditions>
<action type="Rewrite" url="profile.aspx?name={C:1}" />
</rule>