【问题标题】:How can i block root access to the website and only allow requests with a path如何阻止对网站的根访问,只允许带有路径的请求
【发布时间】:2017-12-24 22:10:44
【问题描述】:

我正在使用 IIS URL 重写来访问私人网站,但是我想阻止任何访问根地址的人。

屏蔽

允许

【问题讨论】:

    标签: iis url-rewriting iis-8


    【解决方案1】:

    您可以使用重写规则阻止 root。例如(它会返回 403 状态码):

    <rule name="Block root" stopProcessing="true">
        <match url="^$" />
        <action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Root url is forbidden" />
    </rule>
    

    此规则将阻止

    允许

    【讨论】:

      猜你喜欢
      • 2019-04-22
      • 1970-01-01
      • 1970-01-01
      • 2021-12-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-11
      • 1970-01-01
      相关资源
      最近更新 更多