0

I am trying to add the RequireHttps tag to a controller action but when I try to navigate to it I get a page not found error when I try: https://localhost/MVCDemo3_4/Home/Index2 or http://localhost/MVCDemo3_4/Home/Index2

The Http one tries to redirect to HTTPS but then the HTTPS can't find the page.

4
  • 2
    Do you have a binding setup for HTTPS? Commented Mar 10, 2017 at 22:05
  • I went into IIS Express and clicked on the website and tried to find bindings under the action pane on the right but couldn't find it. Commented Mar 10, 2017 at 22:14
  • blogs.msdn.microsoft.com/rakkimk/2007/05/25/… Commented Mar 10, 2017 at 22:14
  • Above is the link I used. Commented Mar 10, 2017 at 22:14

1 Answer 1

0

It depends more on how this is being hosted than the MVC attribute. If it's running off of a real IIS (or other full httpd) server on locahost, then you just need to make sure IIS is listening on both 80 and 443 (as @Jester mentioned, check the bindings). However, if you are using IIS Express via Visual Studio, then you really can only listen on one port and your debugging needs to be either all non-SSL or all SSL. This is controlled through the propeties on the Web project. Look at the Project URL field.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.