开发者

.htaccess dynamic imageurl rewrite

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 im开发者_JAVA技巧age-url looks like this:

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

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/kln/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

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.


Try this:

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜