asp.net mvc http to https redirect RRS feed

  • Question

  • User-1461109383 posted

    for http to https redirection  i done via code . it's working fine for 443 port. but my application hosted different port . so it's not working. how to resolve it.

    i have placed my sample code here

    Friday, July 10, 2020 9:23 AM

All replies

  • User475983607 posted

    The problem you are trying to solve is not clear.  Secondly, HTTPS is a host configuration.  

    Friday, July 10, 2020 10:41 AM
  • User1686398519 posted

    Hi, satheeshkumarSaRa,

    Since your description of the problem is not detailed enough, I cannot know exactly what you want to do and where your problem happened.

    I have tried your code, there’s no problem except sslPortNumber. If only set it 443, the builder is https://localhost:443/.... and cannot visit, so you need to set it a accurate port number which in your project properties.

    If you want to change port to other number instead of 443, may be it’s not easy. https use SSL to ensure that request is secure and the ports occupied by SSL start with 443 by default.  Modifying the default port of SSL is quite troublesome. So I suggest you don’t do this.

    Best regards,

    Yihui Sun

    Wednesday, July 15, 2020 7:48 AM