Wednesday, March 7, 2018

HTTP to HTTPS redirection

In my current assignment I have created new web application under port 443(with host header site collection) and  enabled both anonymous and NTLM authentication.
And in IIS I have edited the bindings used certificate to make it https site.

Added DNS entry and  it was working as expected.

Ex: If the user browse the site https://test.abc.com its opening the site, but if the user enter

http://test.abc.com then it was not redirecting to my https site and also it was giving 404 error.

From url perspective what ever it was returning that was correct, since  there was no site hosted under port 80 and it was giving 404 error.

Later I thought I will use the IIS URL Redirect module which is available and setup the same in the environment, but it was not working as expected.

In order to fix this later I decided I will add new AAM in the web application under default zone with http url

ex: 

Here I have created AAM with default zone(even though there is default zone already present) with http://test.abc.com

Now bind that host entry in IIS web application like as below

Now we have all the entry for https and http (ignore the other 2 which I have created for my project purpose).

If the user now tries to browse the site with http it will redirect to https

Note:
My IIS application was created under port 443
Its binded with SSL and its extended web application

No comments:

Post a Comment