PDA

View Full Version : I need some help with this rewrite rule



darthmalis
15 Jul 2007, 03:53 AM
I am trying to create a rewrite rule in my .htaccess to allow me to change image names on the fly. I am useless when it come to RegEx and even more so when it come to rewrite rules. Here is the rule I have written:

RewriteRule ^([0-9]+)/.*--(.*)\. (jpg|png|gif)$ /images/$1-$2.$3

Basically I am trying to change the actual image name like 12345-name_of_the_file.gif in my images directory into a an neat URL like 12345/some_dynamic_keyword_related_text--name_of_the_file.gif

I think the rule looks good but I am getting a 500 Internal Server Error message with it in my .htaccess. I am probably missing something stupid here (like maybe it's impossible to do what I'm trying to do.:xeye: )