IIS 7 Url重写 - 匹配子域,但不包括特定URL

Moo*_*ish 3 iis-7 url-rewriting url-rewrite-module

我在网站上设置了URL重写,用户可以在子网站上创建自己的网站.

<rule name="CName to URL - Rewrite" stopProcessing="true">
    <match url=".*" />
    <conditions>
        <add input="{HTTP_HOST}" pattern="^(?!www)(.*)\.basedomain\.com" />
    </conditions>
<action type="Rewrite" url="render_page.aspx?site={C:1}&amp;page={R:0}" />
</rule>
Run Code Online (Sandbox Code Playgroud)

例如,用户可以创建一个页面http://client.basedomain.com/about-us,这将成功地将"client"和"about-us"传递给我的应用程序.

我需要做的是在其域后面的特定页面名称的情况下覆盖此行为.

因此,如果访问了http://client.basedomain.com/restricted页面,它将不会执行上述重写,而是将其重写为url"render_page_restricted.aspx?site = {C:1}

任何帮助是极大的赞赏.

Moo*_*ish 5

以标准的方式,经过几天的工作,然后最终在SE上发布,我在20分钟后破解了它.叹.如果其他人有同样的问题,这是我的修复:

<rule name="Restricted Page Name Override - Rewrite" stopProcessing="true">
    <match url="^(?!www)(.*)restricted" />
    <conditions>
        <add input="{HTTP_HOST}" pattern="^(?!www)(.*)\.basedomain\.com"/>
    </conditions>
    <action type="Rewrite" url="render_page_restricted.asp?site={C:1}" />
</rule>
Run Code Online (Sandbox Code Playgroud)