apache、iis规则屏蔽限制域名访问(适用虚拟主机)
Linux下规则文件.htaccess(手工创建.htaccess文件到站点根目录)
<IfModule mod_rewrite.c>
RewriteEngine On
#Block domain
RewriteCond %{HTTP_REFERER} ads.acesse.com [NC]
RewriteRule ^(.*)$ -[F]
</IfModule>
windows2008,2012或更高系统下规则文件web.config (手工创建web.config文件到站点根目录)
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="屏蔽ads.acesse.com访问">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_REFERER}" pattern="ads.acesse.com" />
</conditions>
<action type="AbortRequest" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
注:根据需求修改ads.acesse.com 屏蔽域名
来源:西部数码