英文:
HTTP redirecting to HTTPS automatically in ASP.NET MVC - how to avoid it
问题
我继承了一个 ASP MVC 应用(Framework),在解决方案属性中 > Web,它是 http 而不是 https。
当我点击 Debug > IIs Express > Edge 时,我被重定向到 https,出现错误连接,如下所示。我在应用程序中到处搜索过,但未能找到任何重定向。谢谢您的帮助。
英文:
I have inherited an ASP MVC app (Framework), in the solution properties > Web, it is http and not https
When I hit Debug > IIs Express > Edge , I get redirected to https with erro connection as you can notice hereunder
I searched everywhere in the app I was not able to find any redirect Thanks for your help
答案1
得分: 4
- HSTS: 您可以在Edge中导航至edge://net-internals/#hsts。在“查询域”文本框中查询“localhost”。如果找到任何内容,请在“删除域”文本框中删除“localhost”。
- Automatic HTTPS: 在Edge中导航至edge://settings/privacy,向下滚动并找到自动切换到更安全的连接以使用自动HTTPS。检查选项是否已打开,如果是,请关闭该选项。
英文:
This might be caused by HSTS or Automatic HTTPS.
- HSTS: You can navigate to edge://net-internals/#hsts in Edge. Query
localhost
in Query Domain textbox. If there's anything found, deletelocalhost
in Delete Domain textbox.
- Automatic HTTPS: Navigate to edge://settings/privacy in Edge, scroll down and find Automatically switch to more secure connections with Automatic HTTPS. Check if the option is turned on, if it is, turn off the option.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论