mod_rewrite dynamic image names
We have a thumbnail processing script which is named thumb.jpg?src=
When the thumbs are generated in the html code, they are all named the same so when our CDN pulls the images to cache, they are not unique.
I'd like to be able to give them each a unique name, but have them rewritten in the htaccess so that they are still using the thumb.jpg scr开发者_Go百科ipt
Here is what I think should work, but it simply isnt working for me.
RewriteRule thumb([a-z0-9-]+).jpg(.*) thumb.jpg$2
Any ideas?
RewriteEngine On
RewriteRule ^thumb([a-z0-9-]+).jpg$ thumb.jpg?src=$1
This will rewrite the request /thumba8.jpg
to thumb.jpg?src=a8
.
Add this robust rule:
RewriteRule thumb(.*)\.jpg$ thumb.jpg?src=$1
精彩评论