开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜