Question

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.

Was it helpful?

Solution

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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top