我在网站上设置了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}&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}
任何帮助是极大的赞赏.