I have a directory for uploaded photos, sorted with date, like this:
http://example.com/uploads/2012-12-08/abcd.png and I created an index.php inside my /uploads/ folder with a .htaccess
I could use the index.php to control the image width and height.
the original url looks like this: http://example.com/uploads/?url=2012-12-08/abcd.png&width=128.
Here's the .htaccess code:
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*) /uploads/index.php?url=$1 [QSA] </IfModule> And if I enter the URL: http://example.com/uploads/2012-12-08/abcd.png&width=128 will appear the resized image
but the issue is the browser display the image extension as png&width=128
also the image URL cannot be shown in some forums, because the & symbol.
how can I change the .png&width=128 into .png?width=128?
I have tried many rules but none work.