Reputation: 41
.Net Application is hosted on IIS Server and SSL is enabled on Default WebSite. All of the application's content is rendered on HTTPS. However, a few images in the same application and directory are being rendered over HTTP. I want everything to be rendered over HTTPS
Below is the log that I found for the images
onReceivedError: -8 error desc: net::ERR_CONNECTION_TIMED_OUT error url: http://XXXXXXX/Simulations/ModelSkins/352018174944853370.jpeg
I expect the above URL to be on https as below
https://XXXXXXX/Simulations/ModelSkins/352018174944853370.jpeg
Upvotes: 0
Views: 71
Reputation: 3504
If your image are displayed like
<img src="http://XXXXXXX/Simulations/ModelSkins/352018174944853370.jpeg" alt="IIS" width="960" height="600" />
Please download and install URL rewrite: https://www.iis.net/downloads/microsoft/url-rewrite
Then you could use outbound rule to rewrite these link by adding and modify following rule to your web .config system.webServer Section:
<rewrite>
<outboundRules>
<rule name="outbound rule">
<match filterByTags="Img" pattern="http://XXXXXXX/(.*\.(png|jpeg))" />
<action type="Rewrite" value="https://XXXXXXX/{R:1}" />
</rule>
</outboundRules>
</rewrite>
Upvotes: 1