Wednesday, March 14, 2018

Is it possible to redirect a URL from HTTP to HTTPS on the same port for IIS?



I have a website located on a custom port number in the server.
Currently, it is serving the users using HTTP.



I was wondering if it is possible to redirect from HTTP to HTTPS while still reusing the same port number in IIS.
E.g http://www.example.com:8000 becomes https://www.example.com:8000




Some of the information I have seen is that I need to use a second binding.
E.g. Bind port 80 for HTTP and 443 for HTTPS and then do a redirect for port 80.


Answer



I don't know what version of IIS you are using but if it is IIS7/7.5 then IIS URL REwrite will do just fine.



Here is a rule to copy into your root web.config



URL REWRITE



http://www.iis.net/download/urlrewrite














No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...