IIS sets the ISAPI filter rewrite component anti-Leech (Anti-leech can save traffic and improve performance)

Source: Internet
Author: User

 

How to add the rewrite component in the ISAPI filter under the IIS settings to prevent image theft links.

First of all, I want to talk about the common phenomenon of "leeching". Although it is not as popular as collecting data, it is still a real solution for the leeching, otherwise, the consumption of resources may affect the normal operation of your website. So what is leeching? How can we prevent information leeching on websites? The following is a simple example:

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.

Generally, leeching is divided into two types: file leeching and image leeching, here, we have to say that some people want to download and image sites when they have hundreds of MB of virtual space. This is why leeching occurs. I was the ideal source code. I found that the real-time download traffic of DU meter increased several times the day before yesterday, but there was no significant change in IP addresses and PVS. For about one day, I took a simple anti-leech protection, the result will return to normal after several minutes. My method is to use the rewrite component, and all my friends who use the discuz forum and static pages know that the following is a simple way to describe in the text-and-text layout. Since there is no technical content, you can make a brick.

1. Download the rewrite package, decompress the package, and install it. skip this step if you have installed the rewrite package on the forum. You can use the window as needed.

2. Open the httpd. ini file in the installation directory and add the following statement at the end.

Reference content is as follows:
Rewritecond HOST: (. +)
Rewritecond Referer :(?! Http: // \ 1 .*).*
Rewritecond Referer :(?! Http ://(. *)(\. baidu \. com | \. google \. com | \. google \. CN | \. g \. CN | \. gougou \. com | \. soso \. com | \. sogou \. com | \. youdao \. com | \. bing \. com | \. yahoo \. com | \. yahoo \. CN | \. txreader \. com )). *

Rewriterule .*\.(? : GIF | JPG | JPEG | PNG | BMP)/images/block.gif [I, O, N]

If the website is rejected, the block.gif image in the root directory of the anti-leech website is displayed. The picture is suitable for the image site. The best picture for the download site is the page Jump. The third line of code is the allowed website.

3. Add an ISAPI filter, as shown in figure

Finally, restart your website and a simple anti-leech system will be completed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.