IIS website anti-theft chain download solution

  
                  

What is the chain of stealing

The definition of "stealing chain" is: this content is not on its own server, but through technical means, bypassing the final page of others who have interests in advertising, directly in their own advertising This content is available to end users on pages of interest. Often there are some small websites that are not known to steal some powerful websites (such as some music, pictures, software download addresses) and then placed on their own websites, in this way stealing the space and traffic of the website. .


Why there is a chain of stealing

An important phenomenon in general browsing is that a complete page is not delivered to the client at one time. If the request is for a page with many images and other information, then the first Http request is sent back to the text of the page, and then the interpretation of the text is executed through the client's browser. Image, then the client's browser will send another Http request. When the request is processed, the image file will be sent to the client, and then the browser will put the image in the correct position on the page, so that a complete page It may take a full Http request to be fully displayed. Based on such a mechanism, there is a problem, that is, the problem of theft chain: if a website does not have the information mentioned in the page, such as picture information, then it can completely connect the picture to other websites. Such a website without any resources uses the resources of other websites to display to the viewers, and increases the amount of visits, and most of the viewers will not find it easily, so obviously, for the website that is utilized resources. It is not fair. Some bad websites expand their own site content in order to increase costs, and often steal links from other websites. On the one hand, it damages the legitimate interests of the original website, on the other hand, it increases the burden on the server.

The chain of stealing I have encountered

The most common types of websites I have encountered are two types of chain stealing. One is the image stealing chain, and the other is the file stealing chain. There used to be a website with a lot of traffic to steal the pictures of my website, and I actually consumed a few G of traffic a day. At the same time, many of the large-scale software that I have put on the platform are often subject to file theft, which consumes a lot of resources.

The solution of the chain stealing

In fact, through the URL filtering technology of the WEB server, this troublesome problem can be easily solved.

If the WEB server uses APACHE, then the ARP Rewrite function that comes with APACHE can easily prevent various kinds of theft. The principle is to check REFER. If the information of REFER comes from other websites, it is forbidden to access. The resources needed.

So, does IIS support UrlRewrite?

The answer is simple and does not support it. But we can make IIS support by installing a third-party server extension.

There is currently a product that can better support IIS's UrlRewrite, named ISAPI_Rewrite.

The download address is at: http://www.helicontech.com/download/

Only one LITE version of ISAPI Rewrite is free, and the others are trial versions. The ISAPI Rewrite Lite version feature does not support virtual site configuration, metadata monitoring and automatic cache cleanup. But the basic UrlRewrite feature is supported.

How to set UrlRewrite?

isapi_rewrite uses regular expressions to represent substitution rules.

Here's a simple example, I want our user to enter http://localhost/test-12314.html to actually access http://localhost/test.asp?id=12314 . Then our match expression should be /test-([0-9]*).html The corresponding format expression should be /test.asp\\?id=$1 .

When writing regular expressions, you can use the regular expression test tool provided by isapi_rewrite (provided by default installation) to debug. With matching expressions and formatting expressions, we can put them in httpd.ini in the installation directory. After the file is saved, it does not need to be restarted for iis to take effect. //This article comes from the computer software and hardware application network www.45it.com

For my website, my anti-theft chain method is to add the following statement in httpd.ini

RewriteCond Host: (. +)

RewriteCond Referer: (?!http://\\1. *).*

RewriteRule .*\\.(?:gif

Copyright © Windows knowledge All Rights Reserved