Jump to content

[SOLVED] simple rule help


benyboi

Recommended Posts

Ok, i am trying to make mod_rewrite forward requests for images to a php page with the image as a variable.

 

e.g. osij9wu09iqwioj0e.jpg fowards to index.php?image=osij9wu09iqwioj0e.jpg

 

i currently have:

Options +FollowSymLinks 
RewriteEngine on 
RewriteRule ^([a-z/0-9/.]+)$ index.php?image=$1 [L]

 

but then because there are not many arguments it forwards to index.php but then to index.php again and gets stuck in a loop...

 

what do i have to change to the rule so that it doesnt work if the page requested is index.php?

 

thanks!

Link to comment
https://forums.phpfreaks.com/topic/83182-solved-simple-rule-help/
Share on other sites

thats for that one!

 

it almost works but can be changed in 2 ways.

a) not all my images are jpg, some gif/png etc

b) with that, the extension of the image isnt copied to the variable. but yes, if they were all jpgs that would be easy to solve but theyr not  :(

 

thanks for your help!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.