Help - Search - Members - Calendar
Full Version: Problem with Hotlinking
Hostony Board > General Support > General Support
bpgisme
Hello everyone! I have a question. My husband has a Nucleus CMS weblog set up that he writes movie reviews on. He takes a lot of screenshots and puts them up in his reviews. The problem is that he's beginning to have some trouble with people on other sites hotlinking to his images instead of downloading them and posting the images themselves. He wants me to turn off hotlinking, which I know can be done, but I need to able to hotlink for the external music sites and things that I use. Is there any way to make his weblog not allow hotlinking without affecting hotlinking ability for the rest of the site?

Thanks in advance! smile.gif
-Bonnie
JasonJones
I'd suggest running the rewrite scripts site wide, and only "allow" the sites you want to be able to link directly to images etc.

But if you only wanted it for one site, you could just add the code to his .htaccess in his main folder.

Jason
bpgisme
You mean like if I needed say for instance CNet to be able to hotlink to an image I could write in .htaccess to allow them to do so and protect the rest of the site, is that right?
Alexandre
You should use
HotLink Prevention
You can find this option in your cpanel

QUOTE
CPanel can prevent hotlinking by only allowing named sites (such as your own web site) to access files on your site.

To prevent hotlinking:

  1.  Click on the HotLink Protection button on the home page.
  2.  Enter any other addresses that you will allow to access your site other than the provided defaults in the central area.
  3.  Enter the protected extensions in the Extensions to allow field. Make sure you separate each extension with a comma.
  4.  Enter the address to redirect any hotlinking to in the Url to Redirect to field.
  5.  Click on the Allow direct requests tick box if you want to allow direct URL access to non-HTML files, such as images.
  6.  Click on the Activate button.
bpgisme
Hello Alexandre!

Can I just turn it on for my husband's weblog though and not for the whole website? I have music files that need to be able to be hotlinked and various images too.
Alexandre
Sure, You can turn it on for your husband's weblog.

Add the following to your .htaccess file and place it in Document Root for the account in question.
QUOTE
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:
QUOTE
RewriteRule .*\.(gif|jpg|mp3|m3u)$ - [F,L]




I think these links will be useful for you:

http://httpd.apache.org/docs-2.1/howto/htaccess.html

http://httpd.apache.org/docs/mod/mod_rewrite.html
bpgisme
Okay! I'll give it a go!

Thanks Alexandre! biggrin.gif

-Bonnie
jfmathieu
Hi,
Is there something like this on windows / helm server ?
Thank
bpgisme
I thought about it for a while and I decided to turn on Hotlinking protection across the board. smile.gif I did put a redirect link up to a custom error page stating that if they like they can email me requesting I allow them to hotlink to the image, but I doubt too many folks will. It's just as easy to download what they want and upload it to their own site, right?

Anyway, thanks for your help guys!


Sorry I can't answer your question Jean-Francois...
Maybe someone else knows the answer? I've been using cPanel the whole time I've been here...

-Bonnie
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