{"id":1454,"date":"2023-09-03T10:48:24","date_gmt":"2023-09-03T10:48:24","guid":{"rendered":"http:\/\/www.netexl.com\/blog\/?p=1454"},"modified":"2026-04-02T09:00:35","modified_gmt":"2026-04-02T09:00:35","slug":"redirect-http-urls-to-https-in-windows-hosting","status":"publish","type":"post","link":"https:\/\/www.netexl.com\/blog\/redirect-http-urls-to-https-in-windows-hosting\/","title":{"rendered":"Redirect HTTP URLs to HTTPS in Windows Hosting"},"content":{"rendered":"\n<p>After configuring SSL for a website, we need to make sure all existing HTTP URLs are automatically redirected to the HTTPS. For this we need to add a redirect rule in our web.config file.<\/p>\n\n\n\n<p>Open your web.config file and add following code snippet under system.webServer tag (copy it before the closing system.webServer tag)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;rewrite>\r\n    &lt;rules>\r\n\t&lt;rule name=\"HTTP to HTTPS redirect\" stopProcessing=\"true\"> \r\n\t    &lt;match url=\"(.*)\" \/> \r\n\t    &lt;conditions> \r\n                &lt;add input=\"{HTTPS}\" pattern=\"off\" ignoreCase=\"true\" \/>\r\n\t    &lt;\/conditions> \r\n\t    &lt;action type=\"Redirect\" redirectType=\"Permanent\" url=\"https:\/\/{HTTP_HOST}\/{R:1}\" \/>\r\n        &lt;\/rule>   \r\n    &lt;\/rules>\r\n&lt;\/rewrite><\/code><\/pre>\n\n\n\n<p>Save web.config file and upload it to the server tp replace existing one. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>After configuring SSL for a website, we need to make sure all existing HTTP URLs are automatically redirected to the HTTPS. For this we need to add a redirect rule in our web.config file. Open your web.config file and add following code snippet under system.webServer tag (copy it before the closing system.webServer tag) Save web.config file and upload it to the server tp replace existing one.<\/p>\n","protected":false},"author":5,"featured_media":1537,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,39,25,14,22],"tags":[],"class_list":["post-1454","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-asp-net","category-godaddy-hosting","category-hosting","category-how-to","category-quick-tip"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts\/1454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/comments?post=1454"}],"version-history":[{"count":1,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts\/1454\/revisions"}],"predecessor-version":[{"id":1455,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts\/1454\/revisions\/1455"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/media\/1537"}],"wp:attachment":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/media?parent=1454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/categories?post=1454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/tags?post=1454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}