question

mohsenMJ-8783 avatar image
0 Votes"
mohsenMJ-8783 asked Philipnicoles-8576 answered

HTTP to HTTPS redirect doesn't work.

Hello,
I used https://tecadmin.net/iis-redirect-http-to-https/ tutorial to redirect all HTTP requests to the HTTPS, but it doesn't work. When I browse "http://my_website.com" then it showed me below error:
135267-https-iis.png

How can I solve it?

Thank you.


windows-server-iis
https-iis.png (202.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TKujala avatar image
0 Votes"
TKujala answered mohsenMJ-8783 commented
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you.
In the HTTP Redirect pane, I entered "https://my_website.com" and restarted the IIS, but I can't browse my website!

0 Votes 0 ·
SamWu-MSFT avatar image
0 Votes"
SamWu-MSFT answered

Hi @mohsenMJ-8783

You need to enable ssl if you want to use https in iis.

  1. Open Internet Information Services Manager.

  2. In the Connections panel on the left, under Sites, select the site for which you want to enable SSL.

  3. In the Actions panel on the right, under Edit Site, select Bindings.

  4. In the Site Bindings dialog box: click Add. then in the Add Site Binding dialog box: in Type, select https. In SSL certificate, select an appropriate certificate from available choices. click OK, click Close.

  5. In the Connections panel on the left, under Sites, double-click SSL Settings.

  6. In the SSL Settings page: select the Require SSL check box, under Client certificate, select Accept.

  7. In the Actions panel on the right, click Apply to save your changes.

More information you can refer to this link: How to Set Up SSL on IIS.


If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

mohsenMJ-8783 avatar image
0 Votes"
mohsenMJ-8783 answered SamWu-MSFT commented

Hello,
Thank you so much for your great help.
I did all of those steps:
135739-ssl-1.png

135833-ssl-2.png
But, as I said, I had a problem!



ssl-1.png (31.7 KiB)
ssl-2.png (21.0 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@mohsenMJ-8783 Try to use failed request tracking to view detailed error information.


0 Votes 0 ·
mohsenMJ-8783 avatar image
0 Votes"
mohsenMJ-8783 answered SamWu-MSFT commented

Hello,
No idea?

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

mohsenMJ-8783 Please check the comment above.

0 Votes 0 ·

Hello,
I created "article.aspx" file and when browse "http://localhost/article.aspx", then it showed me Not Found error.
Why? Should I copy that aspx file in other place?

Thank you.

0 Votes 0 ·

@mohsenMJ-8783 Is the port bound to http://localhost port 80? where did you create the "article.aspx" file? can you show me the configuration of the website in web.config?

0 Votes 0 ·
Philipnicoles-8576 avatar image
0 Votes"
Philipnicoles-8576 answered

Same problem happens with me in Last Month, I use Rewrite code on my website and it redirects to HTTPS and not HTTP. If you need to learn in deep , you refer this link of 301 Redirect HTTP to HTTPS :

https://stackoverflow.com/questions/29029049/best-practice-301-redirect-http-to-https-standard-domain

I hope this will clear your query, If yes please click "Accept Answer" and up vote it.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.