Asp.Net MVC RequireHttpsAttribute 或响应重定向在 IIS6 中不起作用
我正在使用 RequireHttps 属性将 Http 重定向到 Https。它在我安装了 IIS7.5 的开发机器上运行良好。但是,它在 Windows Server 2003 的 IIS 6 中不起作用。因此,我收到了 Http 错误 403.4。 我尝试使用 Response.Redirect(),它也不起作用。所以看来重定向在II6中不能正常工作。 我使用的是.Net 4、MVC 3,QA 机器是带有 IIS6 的 Windows Server 2003。 有谁知道如何解决这个问题?
谢谢! 黄
I am using RequireHttps attribute to redirect Http to Https. It works fine in my dev machine which has IIS7.5 installed. However, it doesn't work in IIS 6 in Windows Server 2003. Thus, I have got Http error 403.4.
I have tried to use Response.Redirect(), it doesn't work either. So it seems that redirection doesn't work properly in II6.
I am using .Net 4, MVC 3, and QA machine is Windows server 2003 with IIS6.
Does anyone know how to solve this problem?
Thanks!
huang
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用 IIS6,并且
Response.Redirect()
至少在某些情况下绝对有效!当您尝试任一选项(
RequireHttps
/Response.Redirect
)时,我会检查到底发生了什么。是否抛出异常?如果没有,什么会返回给客户?您可以使用类似 Fiddler 来查看从服务器返回的原始响应,这可能会提供一些线索。如果您收到错误页面,请检查完整的异常文本/堆栈跟踪。
I use IIS6, and
Response.Redirect()
definitely works in at least some cases!I'd check exactly what's happening when you try either of your options (
RequireHttps
/Response.Redirect
). Are exceptions being thrown? If not, what's being returned to the client?You can use something like Fiddler to see the raw response being returned from the server, which might give some clues. If you're getting an error page, check the full exception text/stack trace.