Answered by:
IIS 8.4 How to redirect http://www.example.com to https://www.example.com with code 301

Question
-
I trying make redirect http://www.example.com to https://www.example.com with code 301 but i get code status 302 and then i redirect status code 301. But i need only code with status 301 without 302Monday, May 21, 2018 7:50 AM
Answers
-
Hi,
Thanks for your question.
1)You could navigate to IIS console > IIS server > HTTP Redirect > Right click “open feature” > Change Status code to 301 as the following figure.
2)You could check your Web.config file and make sure whether you define other URL Rewrite Rules that change status code.
Please refer to the following link for more information,
Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
3) It is recommended to clean the browser cache and test a redirect with 301. Due to if you change the status code, there could be a long-term effective.
Reference link:
HTTP Redirects <httpRedirect>
https://docs.microsoft.com/en-us/iis/configuration/system.webserver/httpredirect/
Hope this helps. I look forward hearing your good news. If you have any questions, please feel free to let me know.
Have a nice day!
Best regards,
Michael
Please remember to mark the replies as an answers if they help.
If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com- Proposed as answer by Michael_hxyMicrosoft contingent staff Thursday, May 24, 2018 4:27 PM
- Marked as answer by Hamid Sadeghpour SalehMVP Monday, October 7, 2019 6:33 AM
Tuesday, May 22, 2018 7:25 AM
All replies
-
Hi,
Thanks for your question.
1)You could navigate to IIS console > IIS server > HTTP Redirect > Right click “open feature” > Change Status code to 301 as the following figure.
2)You could check your Web.config file and make sure whether you define other URL Rewrite Rules that change status code.
Please refer to the following link for more information,
Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
3) It is recommended to clean the browser cache and test a redirect with 301. Due to if you change the status code, there could be a long-term effective.
Reference link:
HTTP Redirects <httpRedirect>
https://docs.microsoft.com/en-us/iis/configuration/system.webserver/httpredirect/
Hope this helps. I look forward hearing your good news. If you have any questions, please feel free to let me know.
Have a nice day!
Best regards,
Michael
Please remember to mark the replies as an answers if they help.
If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com- Proposed as answer by Michael_hxyMicrosoft contingent staff Thursday, May 24, 2018 4:27 PM
- Marked as answer by Hamid Sadeghpour SalehMVP Monday, October 7, 2019 6:33 AM
Tuesday, May 22, 2018 7:25 AM -
Hi,
Just checking in to see if the information provided was helpful. Please let us know if you would like further assistance.
Best Regards,
Michael
Please remember to mark the replies as an answers if they help.
If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.comThursday, May 24, 2018 4:26 PM -
Hi,
Could the above reply be of help? If yes, you may mark it as answer, if not, feel free to feed back
Best Regards,
MichaelPlease remember to mark the replies as an answers if they help.
If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.comMonday, May 28, 2018 1:20 PM