vijay
vijay

Reputation: 25

Sitecore :: Unable to implement redirection request for png, jpg formats

I have the following redirection requirement:

From URL: http://localsource.com/images/products/example.jpg

To URL:localsource.com/some-landing page

I have heard from some expert we need to update web.config file adding extensions like jpg, png, .air for resolving above kind of redirections requests. I am confused here, Can anyone help here please with the exact answer?

Upvotes: 2

Views: 70

Answers (1)

Marek Musielak
Marek Musielak

Reputation: 27132

Install URL Rewrite and add code below to your web.config file:

<rewrite>
  <rules>
    <rule name="Rewrite jpg">
      <match url="^images/products/example.jpg" />
      <action type="Rewrite" url="some-landing page" />
    </rule>
  </rules>
</rewrite>

For more information, check Creating Rewrite Rules for the URL Rewrite Module article.

Upvotes: 1

Related Questions