小编Moo*_*ish的帖子

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

我在网站上设置了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}

任何帮助是极大的赞赏.

iis-7 url-rewriting url-rewrite-module

3
推荐指数
1
解决办法
1447
查看次数

标签 统计

iis-7 ×1

url-rewrite-module ×1

url-rewriting ×1