I was struggeling yesterday to get a dynamic rewrite working... I was trying to get this url: http://static.rad.be/i/phpthumb/php...041-2001-0.jpg&w=50&h=50&bg=ffffff&far=1&q=85 To rewrite to this url: http://static.rad.be/i/phpthumb/phpThumb.php?src=/images/touratech/01-041-2001-0.jpg&w=50&h=50&bg=ffffff&far=1&q=85&fltr[]=wmi|images/watermark.png|C -The two numbers that are colored red are a requirement for the rule to apply... so i want to do this if the number is larger than 50 -The green string is the only part that is relevant to me to locate the file, it should also be a parameter. So this should also work for: http://static.rad.be/i/phpthumb/php...en/148gr.jpg&w=150&h=150&bg=ffffff&far=1&q=85 I was unable to get this to work the way i had in mind... any suggestions?
It looks like they all already do show the exact same thing. http://static.rad.be/i/phpthumb/php...041-2001-0.jpg&w=50&h=50&bg=ffffff&far=1&q=85 http://static.rad.be/i/phpthumb/php...&far=1&q=85&fltr[]=wmi|images/watermark.png|C Mod_rewrite is worthless unless you're linking to them and you change them to something like http://static.rad.be/image/01-041-2001-0/w/50/h/50/ aka...static. Apache goes bonkers if you have stuff like ? and & in the final mod_rewrite url.
What i wanted to achive was add a parameter to an url with already a large number of parameters. Simplified Example: page.php?w=50&h=50&img=flower.jpg Should not be changed, while: page.php?w=100&h=100&img=flower.jpg Should be rewritten to: page.php?w=100&h=100&img=flower.jpg&watermark=watermark.gif|CC so depending on the numeral value of certain parameters i would like to add or not add a certain string to the url... I find it quite difficult to find documentation about this kind or rewrites. It seems it's generally only used to do rewrites from a readable format to a format with parameters... Is there a reason for this that i'm not aware of? Kind regards, And Thanks for the support! Rik
Post that simple version at *gags* webmasterworld.com/apache/ If it's possible, you'll get the answer there. The mod_rewrite King is there.
Simple version: RewriteCond %{QUERY_STRING} w=([0-9]+) RewriteCond %1 >50 RewriteCond %{QUERY_STRING} h=([0-9]+) RewriteCond %2 >50 RewriteRule page\.php page.php?watermark=watermark.gif|CC [QSA] Code (markup): Should be fairly self explanitory - untested but in theory it should work.