Kinda Conditional rewrite

Using mod_rewrite to handle various content issues

Kinda Conditional rewrite

Postby Peutch » Sun Nov 28, 2004 2:52 pm

Hi everyone,
I would like to use a special PHP script to display my picture. So I want a redirection like :
/photos/photofile.jpg --> openpic.php?dir=photos&file=photofile.jpg

The problem is, when I try to display the picture on the openpic page, it is of course redirected and thus cannot be displayed (infinite redirection).

My question is, I would like to redirect the images to the Php script, but not when they are displayed on a certain page (the php script). Is that possible ?

I have tried :
Code: Select all
RewriteCond %{SCRIPT_NAME} !/openpic\.php [NC]
RewriteRule the_redirection_rule

but that does not work...
I have also tried to replace SCRIPT_NAME by REQUEST_URI but it does not work either. Any solution ?

Thank you !
Peutch
Peutch
 
Posts: 3
Joined: Sun Nov 28, 2004 2:44 pm

Postby Caterham » Sat Dec 11, 2004 11:28 am

Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm


Return to Content

Who is online

Users browsing this forum: No registered users and 15 guests

cron