0

I'm currently experiencing an issue whereby my MVC site is not responding correctly using IIS 6.

I've setup a url as http://mysite.co.uk which automatically redirects to the correct MVC home page. As the site contains sensitive information I have added the [RequireHttps] attribute to each controller class to automatically redirect the browser to an https url of https://mysite.co.uk which works correctly.

When I access the site as http://www.mysite.co.uk the site correctly redirects to https://www.mysite.co.uk/Default.aspx but it then responds with

Bad Request (Invalid Hostname)

It looks like any time I use www. as part of the url it fails to respond but I have a hostheader setup as www.mysite.co.uk under the IIS website. Is there anything in particular I need to do to make MVC understand the www. part of the url in terms of routing?

Thanks, Brian.

Brian Scott
  • 9,221
  • 6
  • 47
  • 68

1 Answers1

0

IIS 6 doesn't add ssl host headers as you think it would. see my article at:

http://completedevelopment.blogspot.com/2009/06/multiple-host-headers-ssl-and-wcf.html

Adam Tuliper
  • 29,982
  • 4
  • 53
  • 71