Apache, IIS6, IIS7 independent IP host blocking and restricting domain name access (applicable to VPS cloud hosting)

Published: 2014-12-25

```html

Note: Modify the blocked domain ads.acesse.com as required.


Under Linux Rule file.htaccess (manually create the .htaccess file in the site root directory)

<IfModule mod_rewrite.c>
RewriteEngine On
#Block domain
RewriteCond %{HTTP_REFERER} ads.acesse.com [NC]
RewriteRule ^(.*)$ -[F]
</IfModule>


Under Windows 2003 Rule filehttpd.conf

  1. If our company's assistant environment is installed, please first followhttp://www.west.cn/faq/list.asp?unid=650 to enable the pseudo-static component, then add the following rules.

  2. If it is a pure version system, please followhttp://www.west.cn/faq/list.asp?unid=639 to enable the pseudo-static component, then configure according to the following system rules in the configuration file

#Block domain
RewriteCond %{HTTP_REFERER} ads.acesse.com [NC]
RewriteRule ^(.*)$ -[F]



Under Windows 2008 Rule fileweb.config (manually create the web.config file in the site root directory)


<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
     <rewrite>  
       <rules>
         <rule name="Block access from 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>


```