The definition of "leeching" is that this content is not on its own server, and through technical means, it bypasses the final page of the beneficial interests of others in advertising, this content is provided directly to end users on their own pages with AD benefits. It is often because some small websites with unknown names steal the addresses of some powerful websites (such as music, pictures, and software) and place them on their own websites, this method steals the space and traffic of a large website.
Why is leeching
An important phenomenon in browsing is that not all a complete page is sent to the client at a time. If the request is a page with many images and other information, the first Http request is sent back the text of the page, then explain the text in the browser of the client and find that there are images in the text. Then, the browser of the client will send an Http request, after the request is processed, the image file will be sent to the client, and then the browser places the image back to the correct position on the page, A complete page may be displayed only after multiple Http requests are sent. Based on this mechanism, a problem occurs, that is, leeching: If a website does not contain the information in the page, it can connect the image to other websites. In this way, websites without any resources use other website resources to present the resources to the viewers, which increases their access traffic, and most viewers will not easily find it. Obviously, it is unfair for the website that has been used resources. Some poor websites often steal links from other websites to expand their website content without increasing the cost. On the one hand, it damages the legitimate interests of the original website, and on the other hand it increases the burden on the server.
Leeching I met
My website has two types of leeching at most: Image leeching and file leeching. Once there was a website with a huge access volume that leeched my website's images, it actually consumed several GB of traffic a day. At the same time, many large software with dozens of megabytes on our site are also often hijacked by files, consuming a lot of resources on our site.
Leeching Solution
In fact, this headache problem can be easily solved through the URL filtering technology of the WEB server.
If the WEB server uses APACHE, using the Url Rewrite feature provided by APACHE can easily prevent various leeching. The principle is to check the REFER, if the REFER information comes from other websites, access to the required resources is prohibited.
Does IIS support UrlRewrite?
The answer is simple, not supported. However, we can enable IIS support by installing third-party server extensions.
Currently, there is a product that supports IIS UrlRewrite. Its name is ISAPI_Rewrite.
In: http://www.helicontech.com/download/
Here, only one LITE version of ISAPI Rewrite is free, and others are trial versions. The version of ISAPI Rewrite Lite does not support virtual site configuration, metadata monitoring, and automatic cache cleaning. However, basic UrlRewrite functions are supported. You can also download: http://www.codepub.com/Software/View-Software-8709.h...
How do I set UrlRewrite?
Isapi_rewrite uses a regular expression to replace the expression of the rule.
Below is a simple example where I want our users to input http: // localhost/test-12314.html to actually access asp? Id = 12314 "> http: // localhost/test. asp? Id = 12314. So our matching 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) for debugging. After matching expressions and formatting expressions are completed, we can put them in httpd. ini under the installation directory. After the file is saved, you do not need to restart iis to take effect.
For my website, the anti-leech protection method is to add the following statement to httpd. ini:
RewriteCond Host: (. +)
RewriteCond Referer :(?! Http: // 1 .*).*
RewriteRule .*.(? : Gif | jpg | png | exe | rar | zip)/block.gif [I, O]
Then restart IIS. Then anti-leech protection starts to take effect. All requests sent from other websites are rejected.