htaccess的动态IMAGEURL重写

编程入门 行业动态 更新时间:2024-10-25 00:34:45
本文介绍了htaccess的动态IMAGEURL重写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我要重定向我的所有的产品图片使用htaccess的外部站点。 不过,我无法弄清楚如何使用动态变量,图像的URL看起来是这样的:

I want to redirect all my product images to an external site using htaccess. However I cant figure out how to use dynamic variables, the image-url looks like this:

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

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

其中80×80是高度和宽度,以及10035.jpg是链接到外部图像。 因此,在这种情况下,我想将其重定向到URL,看起来像:

Where 80x80 is the height and the width, and the 10035.jpg is the link to the external image. So in this case I would like to redirect it to an url that looks like:

httpz://www.othersite.nl/imgs/prd/ 九龙 /10035.jpg

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

怎么过,如果源图像150x150-10035.jpg它应该重定向到。

how ever if the source image is 150x150-10035.jpg it should redirect to.

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

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

和我有一些其他的格式,我想重定向。

And I have a few other formats that I would like to redirect.

如果有人可以帮助我一点,我会很高兴。

If someone could help me out a little I would be very happy.

推荐答案

试试这个:

RewriteEngine on RewriteRule 80X80-(.*)$ www.othersite.nl/imgs/prd/kln/$1 RewriteRule 150x150-(.*)$ www.othersite.nl/imgs/prd/std/$1

更多推荐

htaccess的动态IMAGEURL重写

本文发布于:2023-11-01 12:04:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1549283.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重写   动态   htaccess   IMAGEURL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!