This little guide shows you how you can redirect http request to the https website using IIS Settings. You can do the same on other versions of IIS slightly different.
First set “require SSL” under the SSL Settings from the Website
Under the Error Page Settings edit the 403 Error Page
mark the Setting “Respond with a 302 redirect” and add the https URL
Thomas is the EMEA Global Black Belt (GBB) for Sovereign Cloud at Microsoft, helping organizations across the region harness Microsoft’s sovereign, hybrid, multicloud, and edge solutions. He works directly with C-level leaders and technical teams to remove roadblocks, accelerate digital transformation, and shape long-term cloud strategies that meet business and regulatory needs.
With over 15 years of experience in cloud and datacenter, including his previous role as Principal Program Manager and Chief Evangelist for Azure Hybrid, he combines deep technical expertise with a passion for customer success. He specializes in creating scalable architectures, solution accelerators, and thought leadership that drive adoption and innovation on Azure.
Thomas is a passionate community advocate and frequently speaks at industry events such as Microsoft Ignite and Microsoft TechDays. He shares his expertise through his Cloud and Datacenter Blog at www.thomasmaurer.ch and on LinkedIn and X.com www.twitter.com/thomasmaurer.
then maybe you can help me. I’m trying to direct to https://localhost as a test . It stays on the error page and doesnt go anywhere. Does it need to be an actual url ?
I got this to work but the problem is if a website uses virtual directories they will redirect to the home page. Having an absolute redirect doesnt make much sense website.com/a website.com/b website.com/c all need to go to their respective redirect. With an absolute 302 redirect everything goes to website.com
got it working on iis7.5 and 2008R2 but had to edit the error page 403.4 and redirect that single page to https://blah.com
that page is “SSL required – not authorized” btw
This was great, nice and easy in comparison to some other posts/methods I read, thank you.
It worked perfectly outside my network but in my network I get the HTTP Error 403.4 – Forbidden
page instead of it redirecting properly. https still works internally but the redirect does not. I work with some thick headed users and would like it to act the same internally and externally.
Wow..!!. It works like a charm. I was struggling with url rewrite and other coding stuffs .Nothing worked..But this is so simpe and worked like a magic….
This works great. Thanks! For those that mentioned that it didn’t work etc. You may need to ensure that you have port 80 as part of your “Site Bindings” setting.
Well, I have been struggliing with this shit for years on a old server of ours never getting it to work with redirects, URL rewrites and so but then I stumble over your site and gave it a five minut reading and a 10 minuts config and now.. for the first time in ages it works like a charm! If ever in Stockholm, Sweden I´ll buy you lunch! Thanks Thomas
My name is Thomas Maurer. I am a EMEA Global Black Belt (GBB) for Sovereign Cloud at Microsoft. I am part of Azure Cloud & AI Platforms and engage with the community and customers around the world. Opinions are my own.
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
This is such a great, simple solution to this cumbersome ISS problem. Thanks very much!
Of course, rather than the space station, I was referring to MS IIS…
Does not work in IIS 7.5 . Maybe in 7
Did this on a lot of Win2k8 R2 Servers with IIS 7.5, never had a problem :)
then maybe you can help me. I’m trying to direct to https://localhost as a test . It stays on the error page and doesnt go anywhere. Does it need to be an actual url ?
I got this to work but the problem is if a website uses virtual directories they will redirect to the home page. Having an absolute redirect doesnt make much sense website.com/a website.com/b website.com/c all need to go to their respective redirect. With an absolute 302 redirect everything goes to website.com
Maybe you can use the Redirect Feature. But you have to install this Feature first from the Server Manager. This makes it much easier :)
This works for me on iis7.5 win 2008. Simple but so GREAT!!!! it saves me after hours struggling with java/html redirect coding. Thanks a lot Thomas!
absolutely great! it works very well. ;)))
after hours of trying with coding and other found “solutions”, this is the most easiest and working way. thank you very much!
this result should be the first on google search. ;))))))
best regards from germany
michael
got it working on iis7.5 and 2008R2 but had to edit the error page 403.4 and redirect that single page to https://blah.com
that page is “SSL required – not authorized” btw
thanks
Great advise. I really appreciate the info.
This was great, nice and easy in comparison to some other posts/methods I read, thank you.
It worked perfectly outside my network but in my network I get the HTTP Error 403.4 – Forbidden
page instead of it redirecting properly. https still works internally but the redirect does not. I work with some thick headed users and would like it to act the same internally and externally.
Any thoughts would be greatly appreciated.
Does not work under 7.5 for me either. Here is what is returned. Have tried enabling anon authentication but still did not work.
Most likely causes:
– This website requires you to log in.
What you can try:
Go back to the previous page.
More information
This error (HTTP 403 Forbidden) means that Internet Explorer was able to connect to the website, but it does not have permission to view the webpage.
For more information about HTTP errors, see Help.
This worked for me on iis7.5 and 2008R2. Such a simple and elegant solution.
Thanks a lot!
Thank you very much!
Works fine at the Windows 2008 R2 Ent. with IIS 7.5.
Regards!
Works well for Win Server 2012, IIS 8 too:)
thanks for the information
i followed this and i got error saying this webpage has a redirect loop. how can i fix it?
Wow..!!. It works like a charm. I was struggling with url rewrite and other coding stuffs .Nothing worked..But this is so simpe and worked like a magic….
Great it helped you!
This works great. Thanks! For those that mentioned that it didn’t work etc. You may need to ensure that you have port 80 as part of your “Site Bindings” setting.
Thanks,it worked for us..
Hello Thomas,
I’ve tried your method which looks very helpful for my website but i get this error when i try to reach the website.
“This webpage has a redirect loop”
Did you have any similar problem in the past ? Any kind of solution ?
Thanks in advance for help
Take care
Thank you for making redirects from HTTP to HTTP so easy with your excellent visual step-by-step tutorial.
It’s a great and simple solution. It works! Thanks…
Genius… nice and simple… worked a treat. Thanks VERY much
Great post!!! Thank you!
You can also config the redirect domain with or without www using URL rewrite. The SSL cert only include: www FQDN.
web.config example:
Extracted from: http://www.sysadmit.com/2017/05/windows-iis-redirigir-http-https.html
It work in IIS 10 . Thanks
Great post! Simple and worked first try. Thanks!
Well, I have been struggliing with this shit for years on a old server of ours never getting it to work with redirects, URL rewrites and so but then I stumble over your site and gave it a five minut reading and a 10 minuts config and now.. for the first time in ages it works like a charm! If ever in Stockholm, Sweden I´ll buy you lunch! Thanks Thomas
Hi Thomas (great name by the way)
Super happy that I could help.
I will let you know ;)
It´s a great name :)
Well, I have a follow up question. When doing this above I get problems with redirecting subpages (www.coolwebname.se/subpage) since they redirect directly to the startpage (https://www.coolwebname.se) instead of redirecting to https://www.coolwebname.se/subpage. (Occurs when visitors write http://www.coolwebname.se/subpage instead of https://www.coolwebname.se/subpage in the browers.
Any ideas?
Have an awsome day! / Thomas