Asp.Net MVC RequireHttpsAttribute or Response Redirect doesn't work in IIS6

679 views Asked by At

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

1

There are 1 answers

0
Danny Tuppeny On

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.