问题
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>
For this URL:
http://localhost:7514/s3/productimages/112/0718877-21_lg.jpg
Loads this image form Amazon S3:
http://localhost:7514/s3/mybucketname/112/0718877-21_lg.jpg
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
I have tried a million different combinations and I cannot get it.
回答1:
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>
来源:https://stackoverflow.com/questions/22592327/imageresizer-web-config-rewrite-rule-not-working-properly