问题
I'm use this tutorials to add watermark on my images: http://www.reviewsforjoomla.com/forum/index.php?topic=15067.0
All JPG are correctly marked up with this htaccess rule:
RewriteEngine on
RewriteRule ^([^tn].*\.(jpg))$ watermark.php?image=$1&watermark=watermark.png [NC]
Now, i need to apply different watermarks based on file prefix, like:
AA-myimage.jpg (apply aa-watermark.png to all files with AA- prefix)
BB-myimage.jpg (apply bb-watermark.png to all images with BB- prefix)
There is a way to add this on htaccess?
Thanks all!
回答1:
Try this rule:
RewriteRule ^([a-z]{2})-(.+?\.jpg)$ watermark.php?image=$1-$2&watermark=$1-watermark.png [NC,L]
来源:https://stackoverflow.com/questions/20127401/image-prefix-url-rewrite