ImageResizer web.config重写规则无法正常工作 [英] ImageResizer web.config rewrite rule not working properly

查看:63
本文介绍了ImageResizer web.config重写规则无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ImageResizer从我的Amazon S3读取图像,使用此规则,效果很好:

I am using ImageResizer to read images from my Amazon S3, with this rule it is working great:

<rewrite>
    <rules>
      <rule name="Rewrite to s3" stopProcessing="true">
        <match url="^(.*)/(productimages)/(.*)" />
        <action type="Rewrite" url="{R:1}/mybucketname/{R:3}" appendQueryString="true" redirectType="Found" />
      </rule>
    </rules>
  </rewrite>

对于此URL:

http://localhost:7514/s3/productimages/112/0718877-21_lg.jpg

从Amazon S3加载此图像:

Loads this image form Amazon S3:

http://localhost:7514/s3/mybucketname/112/0718877-21_lg.jpg

一切正常,但我需要删除第一个URL中的/s3,所以它将是:

Everything is working BUT I need to get rid of the /s3 in the first URL, so it would be:

http://localhost:7514/productimages/112/0718877-21_lg.jpg

我尝试了100万种不同的组合,但我做不到.

I have tried a million different combinations and I cannot get it.

推荐答案

在不知道您尝试过什么的情况下,很难提供帮助.

Without knowing what you've tried, it's a bit difficult to help.

您尝试过这样的事情吗?

Have you tried something like this?

<rewrite>
    <rules>
      <rule name="Rewrite to s3" stopProcessing="true">
        <match url="^productimages/(.*)" />
        <action type="Rewrite" url="s3/mybucketname/{R:1}" appendQueryString="true" redirectType="Found" />
      </rule>
    </rules>
  </rewrite>

这篇关于ImageResizer web.config重写规则无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆