阿里虚拟主机如何web.config屏蔽IP地址访问?出现HTTP错误500.19无法访问请求的页面数据无效.

发布于 2022-09-11 20:52:35 字数 1771 浏览 35 评论 0

图片描述

图片描述

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
 <system.webServer>
        <defaultDocument>
            <files>
            <clear />
                <add value="index.html" />
                <add value="index.asp" />
            </files>
        </defaultDocument>
           <httpErrors errorMode="DetailedLocalOnly">
           <remove statusCode="404"/>
           <error statusCode="404" path="/404.asp" responseMode="ExecuteURL"/>
           </httpErrors> 
         
            <rewrite>
                <rules>
                <rule name="WWW Redirect" stopProcessing="true">
                <match url=".*" />
                <conditions>
                <add input="{HTTP_HOST}" pattern="^baidu.com$" />
                </conditions>
                <action type="Redirect" url="http://www.baidu.com/{R:0}"  redirectType="Permanent" />
                </rule>

                <rule name="band ip" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAny">
                        <add input="%{HTTP_X_FORWARDED_FOR}&%{REMOTE_ADDR}" pattern="(8.8.4.4|8.8.8.)" />   
                    </conditions>
                    <action type="AbortRequest" />
                </rule>
            </rules>
        </rewrite>
     
      <directoryBrowse enabled="false" />
 </system.webServer>
</configuration>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文