【问题标题】:ImageResizer web.config rewrite rule not working properlyImageResizer web.config 重写规则无法正常工作
【发布时间】:2014-03-23 14:42:24
【问题描述】:

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

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

对于这个网址:

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

从 Amazon S3 加载此图像:

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

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

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

我已经尝试了一百万种不同的组合,但我无法得到它。

【问题讨论】:

    标签: iis-7 rewrite imageresizer


    【解决方案1】:

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

    你尝试过这样的事情吗?

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-23
      • 2019-04-12
      • 1970-01-01
      相关资源
      最近更新 更多