I need to direct all jpeg requests from a particular folder resize
on my website to a specific php script that resizes and compresses the image with the GD library, and at the same time passes parameters to the script. I have no issue with the GD resize/compressing part but it is directing all requests to jpegs to the php script with the necessary parameters.
Is it correct that the best way of doing so is by using htaccess's QUERY_STRING
?
In my php script i have the following parameters needed:
path
size
ratio
So on my page i would call something like:
<img src="http://www.website.com/[folder]/[size]/[ratio]/[path]"/>
i.e
<img src="http://www.website.com/resize/200/square/the-image.jpg"/>
I imagine my htaccess file would be something like so but i don't know what rule i would use:
RewriteEngine On
RewriteCond %{QUERY_STRING} (.*)
RewriteRule XXXXXXXXXXXXXXXXXXXX