There is a web server that runs under the control of DDN (Dot Net Nuke). I want to connect a CDN to it, but I have a huge number of files to which I need to change the paths.

How to make URL module in Rewrite so that when accessing the path to jpg. for example http://site.ru/images/1.jpg I was redirected to http: //CDN-URL/images/1.jpg and picked up all the information on this link?

  • It does not help: <rule name = "CDN-01-js" preCondition = "CheckHTML" stopProcessing = "true"> <match filterByTags = "Script" pattern = "http (s)?: // www. (Site.ru ) / (. * \. js) "/> <action type =" Rewrite "value =" CDN_URL {R: 0} "/> </ rule> - ALEX273chanel

1 answer 1

The following rule should be added to the web.config (in the rewrite -> rules section rewrite -> rules ):

 <rule name="redirect jpg to cdn" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{REQUEST_URI}" pattern=".jpg$" /> </conditions> <action type="Redirect" url="http://cdn.com/{R:0}" appendQueryString="true" /> </rule>