dujmovicv — 2010-01-19T04:38:39-05:00 — #1
This may sound weird but is it possible to redirect from a file.jpg to file.php?
dklynn — 2010-01-19T05:02:45-05:00 — #2
Yes, absolutely! You can match any extension in the regex of a RewriteRule and redirect as required. If you do that, however, remember that the PHP script must then send the image headers that would have been sent for the JPG file.
dujmovicv — 2010-01-19T05:33:16-05:00 — #3
according to that : I need to set up a mod_rewrite rule in a .htaccess which 'says' redirect ALL visits from mysite.com/images/image1.jpg to mysite.com/products.php ?
Thank you in advance!
dklynn — 2010-01-19T16:48:42-05:00 — #4
Not quite - it depends upon which images you want to specify and ...
Well, to redirect ALL .jpg images to your products.php script (products? Perhaps product_images.php?) you would use RewriteRule \.jpg$ product_images.php [L]. Of course, if it's only image1.jpg, then you were fine.