forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: zoomingrocket on November 21, 2004, 10:02:25 am

Title: Preventing Hotlinking...??
Post by: zoomingrocket on November 21, 2004, 10:02:25 am
I read the FAQ of coppermine and accordingly made the following .htaccess file:

SetEnvIfNoCase Referer "^http://www.domian.com/cpg/" locally_linked=1
SetEnvIfNoCase Referer "^http://domain.com/cpg" locally_linked=1
SetEnvIf Referer "^$" locally_linked=1
<FilesMatch "\.(gif|png|jpe?g)$">
  Order Allow,Deny
  Allow from env=locally_linked
</FilesMatch>

As per the instruction the file was uploaded to my albums folder!
Now the big problem is, all the thumbnails on the mail page are itself blocked!
I hovered my mouse and found that they are using full paths,
i.e. http://www.domain.com/cpg/albums/fil.jpg

How to modify so that CPG script uses the local reference, i.e. all img src should be local links, like: /cgp/albums/file.jpg ?? instead of the complete path?

Or is there some other way around to prevent hotlinking?

Note: Here 'domain' is the name of my website! And i am not disclosing so as to prevent any further hotlinking!!


REgards,
Zooom..!!
Title: Re: Preventing Hotlinking...??
Post by: Joachim Müller on November 21, 2004, 10:03:57 am
post the actual content of the .htaccess file with the actual domain name, so we can check.

Joachim
Title: Re: Preventing Hotlinking...??
Post by: zoomingrocket on November 21, 2004, 11:25:58 am
This is my exact .htaccess file in the albums folder

Code: [Select]
SetEnvIfNoCase Referer "^http://www.indianguitartabs.com/igtalbum"

locally_linked=1
SetEnvIfNoCase Referer "^http://indianguitartabs.com/igtalbum"

locally_linked=1
SetEnvIf Referer "^$" locally_linked=1
<FilesMatch "\.(gif|png|jpe?g)$">
  Order Allow,Deny
  Allow from env=locally_linked
</FilesMatch>

On the main page, when i hover my mouse, i see that it shows the complete link, i.e.
http://www.indianguitartabs.com/igtalbum/albums/file.jpg  in the <img src>, so tat means its not locally linking, so all the images goes blank!

Update: I have now added two common hacks for nohover and rightclick disable!!


REgards,
Zooom...!!
Title: Re: Preventing Hotlinking...??
Post by: zoomingrocket on November 29, 2004, 01:16:52 pm
Sorry i had to do this...

BUMP!
Title: Re: Preventing Hotlinking...??
Post by: kegobeer on November 30, 2004, 02:34:45 am
Have you tried this hotlink method?

http://www.mymommybiz.com/seo/preventhotlinking.html