Advanced search  


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.

Pages: [1]   Go Down

Author Topic: HOTLINKING  (Read 4747 times)

0 Members and 1 Guest are viewing this topic.


  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111
« on: June 17, 2004, 05:17:27 pm »

I have read all the posts on Hotlinking, and unfortunatly the .htaccess will not work for me on my windows box.

I have two primary pages that I am seeing is getting hit with Hotlinking:
1.) viewImage.php
     This was added as a mod for watermarking the image

2.) get_file.php

Both of these are being hotlinked, and I would like to do some http referer checking at the tops of these to prevent the hotlinking. I realize this isnt 100%, but its better than nothing. Im not too good with php, but code in coldfusion.

I basiclly want to check the referer at the top, and if its contained in a list of allowed sites, allow the page to continue processing as normal. If its not contained in the allow list of sites, then display a different image.

Thanks in advance.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
« Reply #1 on: June 20, 2004, 12:34:12 am »

what exactly is your question, you seem to know pretty well what you're doing. You'll need something like
Code: [Select]
if ($HTTP_REFERER == '' || $HTTP_REFERER == '') {
// here goes the regular code from the file
} else {
print 'You're a nasty boy, you mustn't hotlink my pages';

Pages: [1]   Go Up

Page created in 0.042 seconds with 19 queries.