c# - How to redirect https request to www as default in ASP.NET MVC hosted on Azure? -


i new asp.net mvc. created website , hosted on azure. turned off ssl on cloudflare acoount. not use further.

currently, site working fine if type www.domain.com. if type https://domain.com , domain.com directly in address bar not working. showing message [see attachment]

how can fix issue, redirect requests coming website either https://domain.com, www.domain.com, domain.com redirected www.domain.com

enter image description here

my web.config file code[which not working]

<rewrite>        <rules>         <rule name="redirect domain.com www"  stopprocessing="true">                     <match url=".*" />                     <conditions>                         <add input="{http_host}" pattern="^domain.com$" />                      </conditions>                     <action type="redirect" url="http://www.domain.com/{r:0}" />                 </rule>             </rules>     </rewrite> 

edit: said before, turned off ssl on cloudflare. when turn on correctly redirecting above code. when turn off not redirecting. want turn off ssl , redirect www requests.


Comments