1. Download the IIS rewrite module provided by Microsoft: http://www.microsoft.com/downloads/zh-cn/details.aspx?familyid= 1b8c7bd8-8824-4408-b8fc-49dc7f951a00
2. Modify the web.config of the website or make a web.config with Notepad, remember to change the *txt format to. config code as follows:
Copy Code code as follows:
<system.webServer>
<rewrite>
<rules>
<rule name= "Prevent hotlinking" >
<match url= "^.*\. (rar|zip) $ "ignorecase=" true "/>
<conditions>
<add input= "{http_referer}" pattern= "http://www.jb51.net/.*" negate= "true"/>
<add input= "{http_referer}" pattern= "http://wt.jb51.net/.*" negate= "true"/>
</conditions>
<action type= "Rewrite" url= "/no.html"/>
</rule>
</rules>
</rewrite>
</system.webServer>
Set the RAR, zip-type files that allow only http://www.jb51.net, Http://wt.jb51.net calls to the Web site.
Upload the above file to the root directory of the site (wwwroot) If the site has set pseudo static, directly to the above code into the original Web.config as can be effective