1

I want to allow partial hotlinking to images on my website. I want to allow a specific site (Reddit) to be able to show an image from my website on their page, but if they click on the link to the image from that site, it should go to an image viewing page, rather than directly the image itself.

For example: This other website should be able to have this

<img src="http://mySite.com/myImage.jpg"/>

on their page, and it should show the image. However, if they have this:

<a href="http://mySite.com/myImage.jpg">Link Text</a>

A user who clicks on that link should get redirected to an image viewing page that contains some html, including the image, rather than directly to the image.

I'm trying to achieve this via mod_rewrite. However, those two cases have the same HTTP_REFERER. Is there anyway for my server to differentiate between that?

lifeformed
  • 525
  • 4
  • 16
  • As simple as NO, unless the remote user agent (browser) will process such request differently, for example: send some additional headers (but I do not know any browser that will do that). – LazyOne Aug 26 '11 at 21:21

1 Answers1

0

There is no way to do such thing! but if second site is your you can put optional query string at the end of URL the distinguish between them!

undone
  • 7,857
  • 4
  • 44
  • 69