{"id":4930,"date":"2023-11-24T09:38:51","date_gmt":"2023-11-24T17:38:51","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=4930"},"modified":"2023-11-24T09:38:53","modified_gmt":"2023-11-24T17:38:53","slug":"how-to-redirect-http-to-https-with-windows-iis-10","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=4930","title":{"rendered":"How to Redirect HTTP to HTTPS with Windows IIS 10"},"content":{"rendered":"\n<p>To create redirection rules in IIS, you must download and install the&nbsp;<strong>URL Rewrite Module 2.1<\/strong>&nbsp;IIS module (<a href=\"https:\/\/www.iis.net\/downloads\/microsoft\/url-rewrite\">https:\/\/www.iis.net\/downloads\/microsoft\/url-rewrite<\/a>).<\/p>\n\n\n\n<p>Then open the Internet Information Services Manager console (<code>InetMgr.exe<\/code>) and select your site.<\/p>\n\n\n\n<p>Go to the&nbsp;<strong>SSL Settings<\/strong>&nbsp;section and make sure that the Require SSL option is&nbsp;<strong>not enabled<\/strong>. If not, this will cause a conflict with the Rewrite URL redirect rule resulting in&nbsp;<strong>403.4 forbidden&nbsp;<\/strong>errors.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/woshub.com\/wp-content\/uploads\/2023\/09\/do-not-enable-ssl-on-iis.png.webp\" alt=\"Do not enable SSL on IIS\" class=\"wp-image-15167\"\/><\/figure>\n\n\n\n<p>Then go to the&nbsp;<strong>URL Rewrite<\/strong>&nbsp;section.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/woshub.com\/wp-content\/uploads\/2023\/09\/install-url-rewrite-module-on-iis-on-windows.png.webp\" alt=\"Install URL rewrite module on IIS on Windows\" class=\"wp-image-15168\"\/><\/figure>\n\n\n\n<p>Select<strong>&nbsp;Add Rule<\/strong>&nbsp;-&gt;&nbsp;<strong>Blank rule<\/strong>.<\/p>\n\n\n\n<p>Specify the rule name and configure the following parameter values:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Requested URL -&gt;&nbsp;<code>Matches the Pattern<\/code><\/li><li>Using -&gt;&nbsp;<code>Wildcards<\/code><\/li><li>Pattern -&gt;&nbsp;<code>*<\/code><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/woshub.com\/wp-content\/uploads\/2023\/09\/create-rewrite-rule-to-redirect-from-http-to-https.png.webp\" alt=\"Create rewrite rule to redirect from HTTP to HTTPS\" class=\"wp-image-15169\"\/><\/figure>\n\n\n\n<p>In Conditions, change&nbsp;<strong>Logical Grouping<\/strong>&nbsp;to&nbsp;<strong>Match All<\/strong>&nbsp;and click&nbsp;<strong>Add<\/strong>. Configure the options:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Condition input -&gt;&nbsp;<code>{HTTPS}<\/code><\/li><li>Check if input string -&gt;&nbsp;<code>Matches the Pattern<\/code><\/li><li>Pattern -&gt;&nbsp;<code>OFF<\/code><\/li><li>Ignore case:&nbsp;<code>enabled<\/code><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/woshub.com\/wp-content\/uploads\/2023\/09\/https-redirect-rule-on-iis.png.webp\" alt=\"HTTPS redirect rule on IIS\" class=\"wp-image-15170\"\/><\/figure>\n\n\n\n<p>Now move on to the&nbsp;<strong>Action<\/strong>&nbsp;section and set:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Action Type -&gt;&nbsp;<code>Redirect<\/code><\/li><li>Redirect URL -&gt;&nbsp;<code>https:\/\/{HTTP_HOST}{REQUEST_URI}<\/code><\/li><li>Redirect type -&gt;&nbsp;<code>Permanent (301)<\/code><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/woshub.com\/wp-content\/uploads\/2023\/09\/create-permanent-redirect-301-to-https-on-iis.png.webp\" alt=\"Create permanent redirect (301) to HTTPS on IIS\" class=\"wp-image-15171\"\/><\/figure>\n\n\n\n<p>Once the redirect rule is created, you will need to reset IIS with the following command:<\/p>\n\n\n\n<p><code>iisreset<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/woshub.com\/wp-content\/uploads\/2023\/09\/iisreset.png.webp\" alt=\"iisreset \" class=\"wp-image-15172\"\/><\/figure>\n\n\n\n<p>Open your browser and try to access your website using the HTTP address. You should be automatically redirected to the HTTPS URL.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/woshub.com\/wp-content\/uploads\/2023\/09\/check-http-to-https-redirect.png.webp\" alt=\"check HTTP to HTTPS redirect\" class=\"wp-image-15173\"\/><\/figure>\n\n\n\n<p>You can also manually enable the HTTP-to-HTTPS redirection IIS rule in the&nbsp;<strong>web.config<\/strong>&nbsp;file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;configuration&gt;\n  &lt;system.webServer&gt;\n    &lt;rewrite&gt;\n      &lt;rules&gt;\n        &lt;rule name=\"rewrite_rule_Redirect_HTTP_to_HTTPS\" patternSyntax=\"Wildcard\" stopProcessing=\"true\"&gt;\n           &lt;match url=\"*\" \/&gt;\n              &lt;conditions&gt;\n                &lt;add input=\"{HTTPS}\" pattern=\"OFF\" \/&gt;\n             &lt;\/conditions&gt;\n           &lt;action type=\"Redirect\" url=\"https:\/\/{HTTP_HOST}{REQUEST_URI}\" appendQueryString=\"false\" \/&gt;\n        &lt;\/rule&gt;\n      &lt;\/rules&gt;\n    &lt;\/rewrite&gt;\n  &lt;\/system.webServer&gt;\n&lt;\/configuration&gt;<\/pre>\n\n\n\n<p>This HTTP to HTTPS redirect rule in IIS will work on the current versions of Windows Server 2022, 2019, 2016, and Windows 10\/11.<\/p>\n\n\n\n<p>Ref: <a href=\"https:\/\/www.ssl.com\/how-to\/redirect-http-to-https-with-windows-iis-10\/\">Redirect HTTP to HTTPS with Windows IIS 10 &#8211; SSL.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To create redirection rules in IIS, you must download and install the&nbsp;URL Rewrite Module 2.1&nbsp;IIS module (https:\/\/www.iis.net\/downloads\/microsoft\/url-rewrite). Then open the Internet Information Services Manager console (InetMgr.exe) and select your site. Go to the&nbsp;SSL Settings&nbsp;section and make sure that the Require SSL option is&nbsp;not enabled. If not, this will cause a conflict with the Rewrite URL <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=4930\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10,14,15],"tags":[1713],"class_list":["post-4930","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-windows-7-8-10","category-windows-servers","tag-redirect-http-to-https-with-windows-iis-10"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4930","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4930"}],"version-history":[{"count":1,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4930\/revisions"}],"predecessor-version":[{"id":4931,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4930\/revisions\/4931"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4930"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}