URL file-access

i took my site down for a while, while i was revising for my exams, now im trying to update i cannot get any antileech scripts to work as i keep getting the message

URL file-access is disabled in the server configuration

does any1 know any antileech scripts that u may use or any i wont have the problem with? thanks

antileech for files not images

allow_url_open is disabled

so how could i get round this, because i wud like to ensure my files are not hotlinked (leeched)

Access your files directly instead of through the URL?

ie: www.domain.com/file
use: /home/user/domain.com/file

That’ll work.

allow_url_fopen is for accessing files on another server. It should never be used for access files within your current site.

this is the file im using


FM AntiLeech Script
Cost: free
Version 1.0.0
Author: Richard Hunt admin@finditmax.com
Created: Jan 10,2004
Web Site: http://www.finditmax.com
Please leave my links intact
I would be greatfull for a link back to my site,
if you use this script - to repay my work.
This program now falls under the GPL License
GPL License details included

//your domain, no http://

//folder that the hidden Downloads files are in, no lead or trailing slashes

if ($filename==""){readfile(“http://www.exetic.com/invalidfile.html”);exit;}
if ($home!=$domain){readfile(“http://www.exetic.com/leecher.html”);exit;
if (ereg(".mp3",$filename)){$xtype=“audio/mpeg”;}
Header(“Content-Type: $xtype”);
Header(“Accept-Ranges: bytes”);
Header(“Content-Disposition: ; attachment; Filename=$filename”);
while (!feof($fp)) {
echo(fgets($fp, 4096));
} //end while
fclose ($fp);

then linking the files via /download/3gp.php?filename.exension

but i keep getting that url error now, so how can i mod that free script as im not good with php

I’m not the expert here, but it seems to me a fix for your problem is simply to refer the the anti-leech related files by path, not by url.

For example, where your script says:


why dont you try:


assuming your “exetic.com” site is hosted at the “base” of your dreamhost account, or


if set-up that way.

In other words, use the path, not the url. You will need to repeat the process for the other referenced files (leecher.html, filenotfound.html, etc.) but I believe that should fix it.

Good Luck,

what rlparker said.

Change http://www.exetic.com/invalidfile.html to the base path of the file, something like /home/user/exetic.com/invalidfile.html

And it’ll work once again.

The image leeching script you have isn’t necessary, anyway. Why not use one of the many .htaccess options out there instead? I wrote about several of them on this page of the wiki.

Simon Jessey
Keystone Websites | si-blog

It’s not image leaching, but true. You can use the same methogoloy for files, too.

i changed the url to the server path, and that worked fine

but it keeps saying file not found


so i changed that link ^^ to the server path, but then it keeps saying files being leeched

so how can i get atileech for files in .htaccess do i just say add zip | rar etc to where gif is?

Yes. There is no reason why the rewrite rules cannot be adapted to suit any file (although that means you should not use the versions that serve alternative images, obviously).

Simon Jessey
Keystone Websites | si-blog

The block matches against a directory or file extensions. Just add in your other file extensions. It doesn’t make any different to Apache.