Results 1 to 4 of 4

Thread: Image Hot-Linking

  1. #1
    Join Date
    Feb 2005
    Posts
    153
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Default Image Hot-Linking

    Is there any sort of script or something available to stop people from hotlinking to images?
    I have seen it before on sites when you try and display an image from another site into a page, you dont get the inteded image, instead a customised image saying that hotlinking isnt allowed.

  2. #2
    Join Date
    Jun 2005
    Posts
    1,081
    Thanks
    4
    Thanked 15 Times in 15 Posts

    Default

    This is done by checking the referrer for each image request.

    In a dedicated server environment it is possible to map the image mime types to a server-side filter, however in a shared hosting environment you would need to ensure your images are not easily found.

    I would recommend doing this by creating a server-side script that checks the referrer and if it is your site then it reads in and writes out the image to the browser. The exact image to serve should be identified either using URLRewriting or by checking a querystring parameter.

  3. #3
    Join Date
    Feb 2004
    Posts
    4,901
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Quote Originally Posted by Sol
    This is done by checking the referrer for each image request.
    You need to remember that not all browsers pass the referrer with the request - something to bare in mind.
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  4. #4
    Join Date
    Jun 2005
    Posts
    1,081
    Thanks
    4
    Thanked 15 Times in 15 Posts

    Default

    Quote Originally Posted by Warren Ashcroft
    You need to remember that not all browsers pass the referrer with the request - something to bare in mind.
    Very good point, as I had this problem recently with a form to email script that I had running on the RFH servers.

    The alternative method is to use Session objects to authorize the user to download the images. You would basically set a session variable when the user visits any of the actual pages and just check that session variable when the user requests an image.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. PHP: Image validation/anti leech
    By E_G in forum Code Sharing
    Replies: 0
    Last Post: 14th March 2006, 03:29 PM
  2. Storing Image in Database
    By jaimalchohan in forum MSSQL
    Replies: 3
    Last Post: 22nd December 2005, 11:19 AM
  3. Image Locations using Front Page
    By bmcdonagh in forum Website and Graphic Design
    Replies: 6
    Last Post: 11th July 2005, 09:48 PM
  4. Checkout this image gallery
    By terraqueotenaz in forum Web Applications and Scripts
    Replies: 2
    Last Post: 12th June 2005, 10:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •