Help - Search - Members - Calendar
Full Version: hotlink not working (2nd cry for help)
Hostony Board > General Support > General Support
bimmer4000
i've enabled hotlink protection in the cpanel. i've added "mp3" to the list of "extensions to allow" and now i can't even retrieve mp3's from my own site (which is in the list of acceptable sites). i've tried it without "mp3" in the list of "extensions to allow" but then hotlinking to my mp3's works from every site, which is of course not what i want.
so what am i doing wrong?
Dark Hedgehog
Strange, I asked about this in a different topic and it seems as if its the same as my host did.

I put a few files up for "allowed" hotlinking, such as my affiliate banners and few things for needed things, and it never worked, it showed up as an "x" on other sites which used them.

But when I enable hotlink protection, its like it ignores the list entirely.

Not sure, but, I am sure there is a problem that can be resolved.
RAGEnCHAOS
the way hotlink works is this

QUOTE
HotLink protection prevents other websites from directly linking to files (as specified below) on your website. Other sites will still be able to link to any file type that you don't specify below (ie. html files). An example of hotlinking would be using a <img> tag to display an image from your site from somewhere else on the net. The end result is that the other site is stealing your bandwidth. You should ensure that all sites that you wish to allow direct links from are in the list below. This system attempts add all sites it knows you own to the list, however you may need to add others.
in mine i have
QUOTE


and i have extentions allowed

QUOTE
jpg,jpeg,gif,png,bmp


now what it does is if you turn on hotlink only the urls in the allowed list will be able to view them so if your doing banners you would have to add each sites URL that would show as the referral or else you get the Dreaded red X and its also the same for direct requests you need to put the site its going to be on in that list or it will not work hope that solves it smile.gif
Dark Hedgehog
What I want to do is this:

http://www.mydomain.com/folder/folder/image.jpg

Am I able to do that?

And I don't have many, only a few.
Don't have a humungous site.
bimmer4000
QUOTE
What I want to do is this:

http://www.mydomain.com/folder/folder/image.jpg

Am I able to do that?

dead link!

anyway, i still haven't got an answer that is useful.
my problem is simple: either all sites can't link to my mp3's or none sites can link. the way it should work is: some sites can (hot)link, all the others can't. and that's what i'm not getting right now.
maybe hostony support staff should reply (hint hint).
Dark Hedgehog
That link doesn't exist, it was an example.

But one I can say is ""http://www.sonicdash.net/darklaughav.bmp"
Danimal
Hey bimmer, make sure your site is in the list of acceptable sites both with AND without the "www" in front. This does make a difference and would indeed prevent you from seeing (or in this case hearing) your own files.

Other than that, without seeing how you have it configured it's hard to know how to help you.
bimmer4000
if i include "mp3" in the list of "extensions to allow", all the sites listed in the box refuse to link to the mp3's. i always get a dialog window asking me for a log in and pw. this is fine for hotlinking sites but not fine for my own site!!!
if i remove "mp3" from the "extensions to allow", all sites listed allow downloading but all external sites can also hotlink to the mp3's.
see screenshot here:
www.metalminutes.com/hotlink.jpg
(i deactivated the jpg extension to allow this screenshot to show up)
Danimal
Well, I set up my hotlink protection manually using an .htaccess file, and when I go into the Hotlink section in CPanel, my list of allowed sites looks MUCH different than that. Here, try changing to this and see what happens:

http://(www\.)?metalminutes.com
http://(www\.)?metalminutes.com.*
http://(www\.)?submissions.metalminutes.com
http://(www\.)?submissions.metalminutes.com.*

The gist of what that'll do is say it should allow linking from either with or without the "www" and from either the main page or a subpage. Is hotlinking to large MP3 files a problem? I don't know of many, if any, sites that do that. It's normally text or picture content.

Anyway, I hope that helps. If it doesn't, I'll ty showing you how to reconfigure your .htaccess file since that's the way I did it.
bimmer4000
i followed your suggestion and added those four lines to the box but it made no difference.
that htaccess thing is chinese for me, so if you could explain, i'd appreciate!
Danimal
Alright then, here's the way I made my .htaccess file:

Using Notepad, create a file called simply ".htaccess" (no quotes but definitely with the period in front) that contains this:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?metalminutes.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?metalminutes.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?submissions.metalminutes.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?submissions.metalminutes.com.*$ [NC]
RewriteRule .*\.(gif|GIF|jpg|JPG|mp3|MP3)$ - [F]

And that's it. If you know your server's IP address, it'd be good to copy one of those lines and change the domain name to your IP address as well. Don't add a space or a blank line after the [F] part. Upload this ASCII to your public_html directory. You can also use the file manager to edit your .htaccess file in the public_html folder to say that (if you've used the Hotlink page in CPanel, you've got an .htaccess file).

This will definitely work to prevent hotlinking. However, if you're meaning that another site is linking to your files through a regular old hypertext link, this won't stop that, that's a different procedure completely.

Hope this helps.
bimmer4000
QUOTE
This will definitely work to prevent hotlinking. However, if you're meaning that another site is linking to your files through a regular old hypertext link, this won't stop that, that's a different procedure completely.

boy, now you got me confused! unsure.gif
if any other webmaster would link to my mp3's, i assume he'd use a "regular old hypertext link". what other way of linking could he do?
Alexandre
Add the following to your .htaccess file and place it in Document Root for the account in question.

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://your_domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.your_domain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.trusted.com/.*$ [NC]
RewriteRule .*\.(gif|jpg|)$ - [F,L]

The 'RewriteRule' is where you include the same file extension of the files to be protected.

Using what was previously mentioned:

RewriteRule .*\.(gif|jpg|mp3|m3u)$ - [F,L]
Danimal
QUOTE(bimmer4000 @ Aug 6 2004, 10:40 PM)
if any other webmaster would link to my mp3's, i assume he'd use a "regular old hypertext link". what other way of linking could he do?

Maybe I should explain, I'm sorry.

If s person simply links to one of your files straight out without linking to the main site, such as by saying CLICK HERE FOR A COOL MP3! (don't click that, it's not a real link), that's just a plain link (called a "hypertext link" because they use hypertext to create them, i.e. <a href="somelink">).

A hotlink is when someone actually displays content from your site on theirs. For instance, instead of using an image on their server, they're actually displaying one from your server, like so:



That image is being displayed on this site, but it's actually loading from the Yahoo main page. This is called Hotlinking. Stealing other people's bandwidth (not to mention content).

The .htaccess file will prevent Hotlinking, but won't stop people from clicking a link and going to your site. That's a completely different deal.

I hope this clears things up a bit.
bimmer4000
to alexandre: .htaccess you suggested makes no difference at all. i can still download my mp3's from a "hostile" site.

to danimal: i'm not very concerned with people hotlinking to my images since i have very little if any images worth stealing. i'm primarily concerned with people using a hypertext link to download and/or play my mp3's. i understand this is not called hotlinking, just plain old linking.
but i want to block the plain old linking to my mp3's. so how do i do that?

other question; would my log-files show if a hostile site is using a hypertext link to my mp3's? if so, i could politely ask them to stop using a direct link to my mp3's.
artrocity
I think what you want to do cannot be solved with
a simple .htaccess IMHO.

You need to password protect the mp3s or
hide them behind a script of some kind.

Pesonally ive never used this script but
I believe it might be what you want.

http://software.anti-leech.com/

They have a free version check it out.
Danimal
No, .htaccess would be of little use unless you know of a specific site or sites you want to stop. It won't stop everyone though. There's also a javascript function that forces people to your main page, but not everyone has javascript on their browser.

Password protection or that software atrocity suggested would be your best bets.

Also, yes you can check your referrers in the the Web Stats section of CPanel. Either AWStats or Webalizer will list them.
Niakie
I'm not sure if this would work, but I found it on another forum and it made me remember this thread. Try useing something like in your .htaccess file:

CODE
# protect images
SetEnvIfNoCase Referer "^http://www.your_domain.com/" locally_linked=1
SetEnvIfNoCase Referer "^http://www.your_domain.com$" locally_linked=1
SetEnvIfNoCase Referer "^http://your_domain.com/" locally_linked=1
SetEnvIfNoCase Referer "^http://your_domain.com$" locally_linked=1
SetEnvIfNoCase Referer "^http://your_ip/" locally_linked=1
SetEnvIfNoCase Referer "^http://your_ip$" locally_linked=1
SetEnvIfNoCase Referer "^$" locally_linked=1

<FilesMatch "\.mp3$">
 Order Allow,Deny
 Allow from env=locally_linked
</FilesMatch>
Alexandre
wink.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.
IPS Driver Error

IPS Driver Error

There appears to be an error with the database.
You can try to refresh the page by clicking here