• 0

Anti Leech PHP Download


Question

Hey everyone,

just wondering can any1 help me out with this.. im trying to protect downloads on my site so people cant easily (without a download manager) get the url of my files. i want people to visit my site rather then download from links all over the net.

i have only got 1 script to work out of the many i have tried. that being Download Lite 1.4 www.stadtaus.com but that puts that persons url in the download file as an advertisment and i cant find a way to remove that. so im back to square one. needing to find a script.

i have no ability in php at all, otherwise i wouldnt be asking i guess. can some1 help me out. i have sspent probably 24hours of total time jsut sitting here installing different scripts and getting nowhere, so many tried so many failed and its frustrating.

if some1 knows a good script and can help me through getting it working on my site i would really appreciate it.

cheers

Fizical

Link to comment
https://www.neowin.net/forum/topic/284625-anti-leech-php-download/
Share on other sites

Recommended Posts

  • 0

Could I get some advice here...

I have a website that isn't hosting pictures, music, or video, but I am still concerned that some ass might run a download manager on my site just to mess with me, eating away at my bandwidth. Because of this I think the easiest way to prevent this problem would be to use .htaccess, since I am just using .html and .jpgs, and this way I can protect those images from over downloading. However, I ran accross this warning about using .htaccess, so i am unsure what I should use at this point

htaccess warning

Using the .htaccess method of anti-leech control is Pretty Wortthless and can often cause many problems for your website.

You may see htaccess code such as this claiming to provide anti-leech control for, in this case, gif jpg and png files.  What this code does is stop any request that was not referred from the yoursite.com domain name.

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com

RewriteRule [^/]+.(gif|jpg|png)$ http://www.yourdomain.com/error.gif [L]

The problem is this method relies on the http-referer code.  The referrer is sent by the client (browser).  That is the problem. Referrer is blocked by many firewalls and is not sent by many configurations.  So you may think you have stopped leeching problems, when what you have really done is block many people from seeing your website.

You can kid yourself into thinking it works, and run a test that shows it does.  But it only blocks people who are sending you can invalid referrer code.  Maybe better than nothing, but not much better.  All those people who get blockled will just go somewhere else assuming your website has too many errors since your images will not show.

To solve this problem, you see many examples like this:

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com

RewriteRule [^/]+.(gif|jpg|png)$ http://www.yourdomain.com/error.gif [L]

The above example adds a line to let through any request which does not have a referrer code.  Yes, this does allow all those configurations which block referrer code to see your images.  However, if you open the door to allow anyone in with no referrer then you are watering down the protection to near worthless.

Then, to make matters worse, the referrer code can be easily faked anyway.

The htaccess anti-leech method is just plain Pretty Worthless.  Do not use it.

If you want to protect your images, consider using a watermark and denying access to the original unwatermarked copy.  You can find a watermark script and associated access control instructions this Tips & Scripts page.

If you are having trouble with a site leeching taking too much bandwidth, block that site.  You can find instructions for blocking traffic to your website on this Tips & Scripts page.

  • 0

Well unless there is a better solution im just going to direct invalid referals to an error.html which explains why they cant download the file. explain why i have done so and what they can do to get around it (turning firewall of, using another browser or something) but then again im not trying to block images which would be a problem for you because people wouldnt see the graphics on your site just text

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I agree, but that's the popular online opinion about them, so I followed it. I do think they have their point, no matter how combative they sound most of the time.
    • M$ can bring whatever the hell it wants, and then guess what's not installed in my Mac.
    • Windows 11's big performance boost is finally available for all by Taras Buria Over the last few months, Microsoft has been very busy fixing Windows 11 with features that users have been asking the company for a long time. An upgraded Start menu, the ability to change the taskbar position, new Windows Update features, and plenty more. However, not all changes are visible on the surface. Some exciting upgrades happened under the hood, and one of those upgrades is now available to all Windows 11 users. The so-called "Low Latency Profile" is a special performance mode that aims to make Windows 11 snappier and more responsive. It boosts the processor clock speed to its maximum for a brief moment when rendering user interface elements or launching apps. As such, apps launch faster, and things like the Start menu or quick settings appear on the screen faster, although some are sceptical about it. Microsoft is not sharing many details about the new profile. The official release notes do not even mention it, with Microsoft only saying that the update "accelerates app launch and core shell experiences such as Start menu, Search, and Action Center." Also, you may need to enable it manually, as new features are rolling out gradually. Here is how to do it: Download ViVeTool from GitHub and unpack wherever convenient. Navigate to the folder containing the ViveTool files with the CD command. For example, if you have placed ViveTool in C:\Vive, type CD C:\Vive. Type vivetool /enable /id:58989092 and press Enter. Restart your computer. After restarting your computer, launch Task Manager or any other hardware-monitoring software and check the processor clocks when opening the Start menu, Action Center, and more. Your processor should spike to its highest possible speed and then return to lower clocks. In addition to Low Latency Mode, the June 2026 Patch Tuesday update delivers additional features, such as multi-camera mode for apps (several apps can use a single camera stream), shared Bluetooth audio, improved Task Manager, and more.
    • I agree, especially with newer versions of MS Office supporting ODF documents, there isn't even a compatibility argument to be made. It should default to ODF on a clean install, with admin configurable options to make MS Office the default if that is desired.
    • Are they on crack at M$? Surely living on an alternative reality? A good dump of mine would run faster down the toilet if I did not flush it. But still looks better than this pile of slop. By the way, did they also comment on what's the next "functionality added"? Maybe you can improve it if you add even more stuff to this vomitware.
  • Recent Achievements

    • Week One Done
      FBSPL earned a badge
      Week One Done
    • One Year In
      Jim Dugan earned a badge
      One Year In
    • One Month Later
      Tommi118 earned a badge
      One Month Later
    • One Month Later
      sjbousquet earned a badge
      One Month Later
    • Week One Done
      sjbousquet earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      488
    2. 2
      PsYcHoKiLLa
      196
    3. 3
      +Edouard
      155
    4. 4
      Steven P.
      84
    5. 5
      ATLien_0
      69
  • Tell a friend

    Love Neowin? Tell a friend!