I tried almost all upvoted suggestions related to web.config changes for http to https redirection.
(我尝试了几乎所有有关将web.config更改从http重定向到https重定向的建议。)
Best way in asp.net to force https for an entire site? (在asp.net中对整个站点强制使用https的最佳方法?)
But its not working for me for my ASP.net site.
(但是它对我的ASP.net网站不起作用。)
I use godaddy shared hosting and have multiple sites in my account. (我使用godaddy共享托管,帐户中有多个站点。)
I have ssl enabled only for one website and have to add it to filter so that other sites in the same account are not redirected to https. (我仅对一个网站启用了ssl,并且必须将其添加到过滤器中,以便同一帐户中的其他网站不会重定向到https。)
Here's my web.config: (这是我的web.config:)
<rewrite> <rules> <rule name="HTTP to HTTPS redirect" stopProcessing="true" enabled="true"> <match url="singledomain.*" /> <conditions> <add input="{HTTPS}" pattern="off" ignoreCase="true" /> </conditions> <action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" /> </rule> </rules> </rewrite>
I can access the site currently by both http and https.
(我可以同时通过http和https访问该站点。)
But it never redirects from http to https. (但是它永远不会从http重定向到https。)
Can someone please assist if I the match condition is correct and if that is what is the problem? (如果我的比赛条件正确,那有什么问题可以帮助吗?)
Thanks.
(谢谢。)
ask by Ganesh S translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…