.htaccess动态图像重写

Dir*_*kZz 3 apache .htaccess redirect image dynamic

我想使用htaccess将我的所有产品图片重定向到外部网站.但是我无法弄清楚如何使用动态变量,image-url看起来像这样:

httpz://localhost/oc1505/image/80x80-10035.jpg

其中80x80是高度和宽度,10035.jpg是外部图像的链接.所以在这种情况下我想将它重定向到一个看起来像这样的网址:

http://www.othersite.nl/imgs/prd/ kln /10035.jpg

如果源图像是150x150-10035.jpg它应该重定向到.

httpz://www.othersite.nl/imgs/prd/ STD /10035.jpg

我还有一些其他格式,我想重定向.

如果有人能帮我一点点,我会非常高兴.

Rak*_*kar 7

试试这个:

RewriteEngine on
RewriteRule 80X80-(.*)$ https://www.othersite.nl/imgs/prd/kln/$1
RewriteRule 150x150-(.*)$ https://www.othersite.nl/imgs/prd/std/$1
Run Code Online (Sandbox Code Playgroud)