Stopping people from linking files on your site to their site

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Akito

Thread Starter
Joined
May 23, 2003
Messages
931
I run a music website, and I am finding that people are using my bandwidth by linking the files from my site to their site (Does that make any sense?). It want to stop this, because it's wasting my money. I would like it so if they try to link a file it says "Linking file from x site" or something like that (geocities does this with images). I know its possible just not sure how.
 
Joined
Jul 8, 2002
Messages
14,681
What serverside languages do you have access to?

Or are you running on an Apache server? if you are I think you can use htaccess to do this.
 

Akito

Thread Starter
Joined
May 23, 2003
Messages
931
I am in fact running apache, and I have access to PHP and Perl (I prefer PHP though, since I'm rusty with perl)

Thanks!
 
Joined
Jul 8, 2002
Messages
14,681
Create a file called .htaccess, and put this in it
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?nerocom\.us/
RewriteRule \.(mp3)$ - [F]
it should stop remote loading of MP3 files.
 

Akito

Thread Starter
Joined
May 23, 2003
Messages
931
Hmm.. it's actually midi files.

Anyways, it didn't stop it, (I changed it to (mid) but was still able to link from other places)
 
Joined
Jul 8, 2002
Messages
14,681
Try this one, slightly different
btw I don't know exactly what these htaccess options are-Im just getting them from google.

RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?nerocom.us/.*$ [NC]
RewriteRule \.(mid)$ - [F]
 
Joined
Jul 8, 2002
Messages
14,681
Maybe you need to CHMOD the files to something so they can only be read by your site-I'm not really sure. Im looking it up though.
 

Akito

Thread Starter
Joined
May 23, 2003
Messages
931
Well chmod worked - but it blocked me from my site as well. Also, that code didn't stop anything at all. HMMM!
 
Joined
Apr 30, 2001
Messages
2,636
One thing you want to make sure the code does, is deny access to the midi if the referrer is null.

If somebody puts the link on their site, I can just copy the shortcut and paste it into the address bar and there will be no referrer and I will be able to download the file. I think someone could use javascript to allow clicking on the link with no referrer either, so if the referrer is null, redirect them to your front page or the download page on your site.

You can also disable referrer logging with opera.
 
Joined
Apr 30, 2001
Messages
2,636
Good point. Possibly; depending on the code. I've seen perl scripts that only allow you to download the file, if you goto the actual page and left-click. right-click and save-as won't work. And I believe it wouldn't allow the streaming of the files either. It used a form buttom that you had to click on and also used some validating code that ensured the link to the file was coming from the page.

All the midis have a direct link to them. You should have to visit one of your pages set a cookie and have the server retrieve the file based on the session and make sure the session expires after a certain amount of time.

Just busting out some ideas.

I really don't see why people would link to them from their sites, when they could just download them all, zip them up and put them on their site in a matter of minutes. Either way it would be stealing and not giving you Credit for visits/downloads, but I myself wouldn't bother linking to the files, I would just get them all and offer them myself.

The direct links to the files, I think are the problem.

This is kind of what I am talking about
http://www.sitepoint.com/avantgo/article.php?aid=1156

Used with a form of course.
You would have to prevent people from passing the id string directly in an url.

I suppose you could also have it so that whenever somebody downloads one of the midis directly, the download actiion popups the web page that you need people to go to.

Just some ideas.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Top