Image prefix (url rewrite)

不羁岁月 提交于 2019-12-13 04:40:42

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!