Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Allow hotlinking for thumbnails?  (Read 3586 times)

0 Members and 1 Guest are viewing this topic.

AvrilBoi

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Allow hotlinking for thumbnails?
« on: May 23, 2007, 11:53:49 pm »

Hi!
I have put a .htaccess file in my /albums/ folder, to prevent hotlinking.
This is the code:
Code: [Select]
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?allowed_site_1.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?allowed_site_2.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?allowed_site_3.com [NC]
RewriteRule \.(jpg|jpeg|png|gif|bmp)$ http://www.alternative_server.com/hotlink.gif [NC,R,L]
Is there any way to allow people to hotlink thumbnails? My thumbnails are named by coppermine default: "thumb_filename.jpg"
Thanks
« Last Edit: May 26, 2007, 04:50:14 pm by TranzNDance »
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Allow hotlinking for thumbnails?
« Reply #1 on: May 24, 2007, 07:07:45 am »

It doesn't seem possible unless you use a different file extension for thumbs. For example, if you use .jpeg for thumbnails and erase jpeg from the list of protected files types.

This would require making changes to the Coppermine code, so I wouldn't really recommend it. Perhaps someone could propose a better idea.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Allow hotlinking for thumbnails?
« Reply #2 on: May 24, 2007, 08:30:36 am »

There's no easy solution: you either allow hotlinking or you disallow it. You can't come up with a determination that hotlinking of thumbs is allowed, but intermediate/fullsize hotlinking is forbidden.
As Thu suggested: it would require extreme hacking to accomplish this.
Logged

AvrilBoi

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Re: Allow hotlinking for thumbnails?
« Reply #3 on: May 26, 2007, 03:25:47 pm »

Ok thanks...
I've asked that because I've read something like this
Code: [Select]
RewriteCond %{REQUEST_FILENAME} !(.*thumb|.*highlight) [NC]somewhere else so I thought that would be possible.
Logged

AvrilBoi

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Re: Allow hotlinking for thumbnails?
« Reply #4 on: May 26, 2007, 03:31:12 pm »

Sorry for this double post, but I just figured out that that code works!
Code: [Select]
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !(.*thumb|.*highlight) [NC]
RewriteCond %{HTTP_REFERER} !^$
etc. etc.
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Allow hotlinking for thumbnails?
« Reply #5 on: May 26, 2007, 04:44:27 pm »

Interesting. Thanks for coming back and posting the solution.
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 16 queries.