Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I am implementing outbound rule rewriting for image but its not working. any one can tell me what is problem to execute this.
Web.Config
XML
<system.webServer>
    <rewrite>
      <outboundRules>

        <rule name="CDN_ReWrite_Images" enabled="false" preCondition="IsHtml" stopProcessing="true">
          <match filterByTags="Img, Link, Script" pattern="^(.*)/(Images)/(.*\.(css|js|jpg|jpeg|png|gif|ico|bmp|svg|swf))" />
          <action type="Rewrite" value="http://staging-cdn.dotnetheaven.netdna-cdn.com/{R:2}/{R:3}" />
          <conditions>
          </conditions>
        </rule>

        <preConditions>
          <preCondition name="IsHtml" logicalGrouping="MatchAny">
            <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
          </preCondition>
        </preConditions>

      </outboundRules>
    </rewrite>
  </system.webServer>


ASP.Net Page Code:
ASP.NET
<div>
        <img src="images/12112015055956AM.png" alt="Twitter" />
        <asp:Image ID="Image1" runat="server" ImageUrl="~/images/12112015055956AM.png" />
    </div>
Posted
Comments
aarif moh shaikh 21-Dec-15 23:50pm    
what error you getting?
Member 10711621 22-Dec-15 1:27am    
I am not getting any error . but it is not changing actual link by outbound rule link.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900