We are having more than 300 pages in my website project. Over the time we have created a new server which is secure. This server is specially used for all the images in website.
So here is the scenario:
current implementation for images ( in aspx, in css )
http://www.mysite.com/assets/common/image1.jpg
sometimes in webpage and css it is specified like this
~/assets/common/image1.jpg
would like to use somethig like this.
http://www.static.mysite.com/common/image1.jpg
and for secure pages
https://www.static.mysite.com/common/image1.jpg
So as you can see all the images are coming from ~/assets
folder BUT now I want to create a rule replacing ~/assets
with http://static.mysite.com
How can I achieve this in IIS using rewrite rule.
EXAMPLE:
ASPX
<img src="/assets/common/image1.jpg" id="ImageId1" alt="Image" width="100" height="100" />
<img src="http://mysite.com/assets/common/image2.jpg" id="ImageId2" alt="Image" width="100" height="100" />
Would like to have IIS rule, when finds above code, replace it with http://static.mysite.com/common/image1.jpg
<img src="http://static.mysite.com/common/image1.jpg" id="ImageId1" alt="Image" width="100" height="100" />
<img src="http://static.mysite.com/common/image2.jpg" id="ImageId2" alt="Image" width="100" height="100" />