IIS 默认重定向
在IIS7中,如果网站级别的默认重定向是相对路径,如何使默认重定向在https而不是http上。
目前,如果主机是:abc.com 并且登录页面是 abc.com/myapp/login.aspx,我将默认重定向(IIS 管理器 -> HTTPRedirect)设置为 /myapp/login.aspx。因此,如果用户在浏览器地址栏中输入 abc.com,他将被重定向到 http://abc。 com/myapp/login.aspx。我想确保用户被重定向到 http*s*://abc.com/myapp/login.aspx。
它需要根级别的 web.config 吗?
请注意,这不能在 ASP.NET 代码中完成,因为 ASP.NET 代码不参与此请求的处理
编辑: 一种方法是在根(网站)级别部署一个“默认”Web 应用程序,即 Web 应用程序,然后使用 ASP.NET 提供的标准重定向模块。对优点和缺点有什么想法吗?
In IIS7, if the default redirect at the website level is a relative path, how to make the default redirect is on https and not http.
Currently if the host is: abc.com and the login page is abc.com/myapp/login.aspx, I set the default redirect (IIS manager -> HTTPRedirect) to /myapp/login.aspx. So, if the user enters abc.com in his browser address bar, he gets redirected to http://abc.com/myapp/login.aspx. I want to make sure the user gets redirected to http*s*://abc.com/myapp/login.aspx.
Would it need a web.config at the root level?
Note that this cannot be done in asp.net code, because the asp.net code is not involved in the processing of this request
Edit:
One way to do it is having a "default" web app i.e. web app deployed at the root (web site) level and then use the standard redirection module available with asp.net. Any thoughts on pros, cons?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最后我们提出了 3 个不同的选项:
window.location.href 到 https URL。
选择选项 3 的原因是:
Finally we came up with 3 different options:
window.location.href to the https URL.
The option 3 was selected based on :