1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

.htaccess for just ONE image

Discussion in 'Apache' started by SoftCloud, Jul 15, 2012.

  1. #1
    Hello,

    I am just wondering how would I go about redirecting someone from an image to a page with the images on?

    For example: If someone tweets a certain image (eg; www.blah.com/images/smile.jpg) and someone clicks it, it shows that image, however instead, I want the person to be redirected to a page that's got the image on (eg; www.blah.com/gallery.php), instead of seeing just the image - if you get me?

    I only want this to work for just one image aswell.

    Any help would be grand! :)
     
    SoftCloud, Jul 15, 2012 IP
  2. khalonn

    khalonn Greenhorn

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    Not tested, try something like this in your images directory

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?yoursite\.com [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule \.(jpeg|jpg|gif|bmp|png)$ /otherdirectory/otherfile.ext [L]
     
    khalonn, Aug 9, 2012 IP