1

My app uses HTTPS only. I have SSL enabled from the properties window. Everything works well except, when I run the project, it runs on HTTP. I then have to

  • change the URL manually to HTTPS, and then
  • change the port number to the SSL one.

How can I force the app to run as HTTPS? Is there a quick fix for that (without using logic in my pages)? I searched for this, but I haven't found a case that matches mine.

Note: I am using ASP.NET MVC4 with web API.

Josh Darnell
  • 11,304
  • 9
  • 38
  • 66
Labib Ismaiel
  • 1,240
  • 2
  • 11
  • 21

1 Answers1

2

You'll need to detect if the request came in http or https, and redirect if http to https. The below post should have some hints

Best way in asp.net to force https for an entire site?

Community
  • 1
  • 1
pcreech
  • 334
  • 1
  • 9