943,962 Members | Top Members by Rank

Nov 29th, 2004
0

Redirecting images depending on the page they are displayed on.

Expand Post »
Hi everyone,
I would like to redirect my images to a php page so they'd be nicely displayed and I could track their frequentation. Let's say my display page is called openpic.php

The problem is, if I put an htaccess simple RewriteRule, all images will be subject to redirection, including the one that is displayed on openpic.php, thus creating a loop. (The image then appears as not available.)

My question is : I would like to redirect my images, except when they are displayed on openpic.php

Is that possible ?
I have tried a RewriteCond with HTTP_REFERER or REQUEST_URI but it does not seem to work. Maybe I got it wrong. I tried something like
RewriteCond %{HTTP_REFERER} !/openpic.php
RewriteRule [blabla.jpg -> openpic.php?file=blabla.jpg]

Can anyone help with my RewriteCond ? I'm not even sure what I'm trying is possible.

Thanks !! :o
Similar Threads
Reputation Points: 10
Solved Threads: 0
Unverified User
Peutch is offline Offline
1 posts
since Nov 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Linux Servers and Apache Forum Timeline: mod_rewrite: help with regular expressions
Next Thread in Linux Servers and Apache Forum Timeline: Static WAn ip





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC