How can this leeching function be implemented?

Source: Internet
Author: User
For example, if you want to download a ZIP or RAR file from my website, you must download it on my website. Copy the link and place it on another website. The following message is displayed: "This website prevents leeching, please download from the specified location on this site"

Apache now supports the mod_rewrite.so module.

Apache version: 2.0.52

Thank you!
First, make sure that the server interpretation engine of your server or space is apache2, And the. htaccess client setting file is supported,
If you have your own server, first modify the./CONF/httpd. conf file as follows:
Find # loadmodule rewrite_module modules/mod_rewrite.so
Discard the previous #
Change AllowOverride none to AllowOverride all.
Restart apache2 server

Next, create a. htaccess file. The content of the. htaccess file is

Rewriteengine on
Rewritecond % {http_referer }! ^ Http://173.com.ru/.#$ [Nc]
Rewritecond % {http_referer }! ^ Http://173.com.ru $ [Nc]
Rewritecond % {http_referer }! ^ Http://www.173.com.ru/.#$ [Nc]
Rewritecond % {http_referer }! ^ Http://www.173.com.ru $ [Nc]
Rewriterule. */. (JPG | JPEG | GIF | PNG | BMP | RAR | zip | exe) $ http://down.173.com.ru/err.html [R, NC]

The colored items must be changed to yours:
RED: You provide the download page address, that is, you can only download the provided stuff through this address.
Blue: To protect the file extensions (separated by |), that is, files with these extensions can only be accessed through red addresses.
Green: if you do not use a red address to access files with blue extensions, the system redirects back to the green address.

The next step is how to use the. htaccess file to implement anti-leech.
First, you need to create two directories in the space (of course, the directory name is yours), one for the web and the other for the down,
The Web is used to download pages (or download programs), and down is of course the stuff you provide,
Change the red part of the. htaccess file to http: // your domain name/web. Blue part
Change to the file extension you want to protect. Change the green part to http: // your domain name/web. Save after modification
Upload the. htaccess file to the down directory.

Now, you don't need to buy any big-sized servers.
Function, we are people below the Hill who have the money to access the Internet and create a free space.

The above test:
Http://173.com.ru/downs.html
There is a [anti-leech-related] above. There is a PHP program that can generate a. htaccess file in your space. If
You will not create a. htaccess file or your space cannot upload a. htaccess file.
PHP programs are directly generated in your space.
PHP Program
Http://down.173.net.ru/fdowns.rar
 

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.