{"id":89886,"date":"2020-10-15T16:00:14","date_gmt":"2020-10-15T13:00:14","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/setting-up-https-redirects-in-iis-and-securing-your-urls-cloudsavvy-it\/"},"modified":"2020-10-15T16:00:14","modified_gmt":"2020-10-15T13:00:14","slug":"setting-up-https-redirects-in-iis-and-securing-your-urls-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/setting-up-https-redirects-in-iis-and-securing-your-urls-cloudsavvy-it\/","title":{"rendered":"#Setting Up HTTPS Redirects in IIS and Securing Your URLs \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2d520b02d2c\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2d520b02d2c\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/setting-up-https-redirects-in-iis-and-securing-your-urls-cloudsavvy-it\/#Why_Would_I_Need_to_Redirect_from_HTTP_to_HTTPS\" >Why Would I Need to Redirect from HTTP to HTTPS?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/setting-up-https-redirects-in-iis-and-securing-your-urls-cloudsavvy-it\/#Navigating_to_the_Redirect_Module\" >Navigating to the Redirect Module<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/setting-up-https-redirects-in-iis-and-securing-your-urls-cloudsavvy-it\/#Creating_Your_First_Redirect_Rule\" >Creating Your First Redirect Rule<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/setting-up-https-redirects-in-iis-and-securing-your-urls-cloudsavvy-it\/#Testing_Redirections_to_Confirm_All_Website_URLs_Redirect_to_HTTPS\" >Testing Redirections to Confirm All Website URLs Redirect to HTTPS<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#Setting Up HTTPS Redirects in IIS and Securing Your URLs \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-7362 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/thumbcache\/0\/0\/5ea9233849fa429b17f42871206ab447\/p\/uploads\/2019\/09\/6956a5c5.png\" alt=\"Microsoft IIS.\" width=\"700\" height=\"300\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>In order to force your website to load over SSL, you will likely need to incorporate redirection to push all insecure URLs to their secure counterpart. This is necessary to be sure that all users and pages support and utilize your SSL certificate to encrypt communications between your web server and visitor.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Why_Would_I_Need_to_Redirect_from_HTTP_to_HTTPS\"><\/span>Why Would I Need to Redirect from HTTP to HTTPS?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To properly secure your website with SSL certificates, you might decide to incorporate redirects on your website, forcing all <em>http <\/em>URLs to redirect to secure <em>https<\/em> URLs, (i.e.,\u00a0<em>http:\/\/mydomain.com<\/em> redirects to <em>https:\/\/mydomain.com<\/em>). This way, no matter what URL a user is visiting on your site, it will automatically be directed to the secured version of that page.<\/p>\n<p>Without redirects in place, some users or pages may be accessing insecure URLs and will not receive the benefits of having an SSL certificate in place. Let\u2019s take a look at how to incorporate these changes in IIS with the URL Rewrite Redirection Module!<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Navigating_to_the_Redirect_Module\"><\/span>Navigating to the Redirect Module<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The first thing we will need to do is navigate to our Redirection Module. To do this, open up IIS Manager (inetmgr.exe), expand your server, and select the site you want to incorporate redirects on.<\/p>\n<p>In the main window pane, scroll down until you find \u201cURL Rewrite\u201d under the IIS subcategory and double-click this icon.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-1574 size-large\" src=\"https:\/\/www.cloudsavvyit.com\/thumbcache\/0\/0\/7afcd345d5e143ad644d4b3c8288bea4\/p\/uploads\/2019\/08\/5d6753e6-1024x610.png\" alt=\"Find &quot;URL Rewrite&quot; under the IIS subcategory.\" width=\"640\" height=\"381\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>If you do not see this module, you will have to install it from the official IIS site, <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/www.iis.net\/downloads\/microsoft\/url-rewrite\">here<\/a>.<\/p>\n<p>Note that the URL Rewrite module is only available for IIS 7 or higher.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Creating_Your_First_Redirect_Rule\"><\/span>Creating Your First Redirect Rule<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Now that you have opened the URL Rewrite module, select \u201cAdd Rule(s)\u201d from the upper-right actions menu. We are going to create a Blank Rule.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-1575 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/thumbcache\/0\/0\/84f892aa2b820dc63498f53a2562e72b\/p\/uploads\/2019\/08\/4f7f0f3c.png\" alt=\" Create a Blank Rule,\" width=\"676\" height=\"453\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>To create a redirect rule that forces all HTTP URLs to HTTPS, you will need to create a rule with the following settings:<\/p>\n<p><strong>Requested URL:<\/strong> Matches the Pattern<br \/><strong>Using:<\/strong> Regular Expressions<br \/><strong>Patten:<\/strong> (.*)<\/p>\n<p>\u2026with the \u201cIgnore\u201d Case box checked.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-1576 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/thumbcache\/0\/0\/183da740f248a6e1498a076ce9e71d9d\/p\/uploads\/2019\/08\/e6c5ec57.png\" alt=\"Create a rule with the &quot;Ignore&quot; Case box checked.\" width=\"974\" height=\"819\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>By setting the pattern to (.*) and matching to regular expressions, the redirect rule will match and process any URL that it receives. The (.*) regex pattern matches all possible combinations of characters in the URL.<\/p>\n<p>Once these settings are in place, scroll down to the \u201cConditions\u201d section and expand the drop-down menu.<\/p>\n<p>Select \u201cAdd\u201d and enter the following settings:<\/p>\n<p><strong>Condition Input:<\/strong> {HTTPS}<br \/><strong>Check if input string:<\/strong> Matches the Pattern<br \/><strong>Pattern<\/strong>: ^OFF$<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-1577 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/thumbcache\/0\/0\/2536ecab7d30a7ac54c08dfc578c21d1\/p\/uploads\/2019\/08\/eb1b2bef.png\" alt=\"Select the &quot;Conditions.&quot; \" width=\"717\" height=\"685\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Click \u201cOK.\u201d<\/p>\n<p>Now, on the \u201cEdit Inbound Rule\u201d page for our new rule, scroll down to the \u201cAction\u201d section.<\/p>\n<p>You will be setting the Action Type as \u201cRedirect\u201d and enter the following URL under the redirect URL section:<\/p>\n<p>https:\/\/{HTTP_HOST}{REQUEST_URI}<\/p>\n<p>Be sure to uncheck \u201c<a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">App<\/a>end Query String\u201d and make sure the Redirect Type is \u201cPermanent (301).\u201d<\/p>\n<p>Note: In case you are having some difficulties with the redirect by the end of this article, another option to try for your redirect URL would be:<\/p>\n<p>https:\/\/{HTTP_HOST}\/{R:1}<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-1578 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/thumbcache\/0\/0\/39d7ffda35add520a898043d515739bc\/p\/uploads\/2019\/08\/304d9a03.png\" alt=\"Set the Action Type as &quot;Redirect&quot; and the Redirect Type as &quot;Permanent (301).&quot;\" width=\"714\" height=\"736\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>We are using Permanent (301) redirects for our site because we want all non-secure URLs to be automatically and permanently redirected to the secure https version of the URL. There are several other types of redirects available, but the 301 redirect will get our website behaving the way we want it it to for HTTPS.<\/p>\n<p>Once you have confirmed that all of the above settings are correct, select \u201cApply\u201d in the top-right Actions pane.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Testing_Redirections_to_Confirm_All_Website_URLs_Redirect_to_HTTPS\"><\/span>Testing Redirections to Confirm All Website URLs Redirect to HTTPS<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Once you have applied the new redirect rule to your website, you are now able to test the redirection in your browser.<\/p>\n<p>To be sure that your browser is not using cached data when being accessed, open a \u201cPrivate\u201d or \u201cIncognito\u201d window and navigate to any http URL on your site.<\/p>\n<p>When accessing these URLs, it should automatically redirect to the HTTPS version of your page. Assuming you have already tested your SSL certificate prior to the redirect, when your non-secure URL is redirected, it should now show https and a secure lock icon by the URL bar.<\/p>\n<p>If you are having difficulties with your redirect or you see it is not redirecting properly, it is in our interest to check the web.config file in the associated website to be sure that our redirect rule was properly added.<\/p>\n<p>You can check this by navigating to your site in IIS, right-clicking on its name, and selecting \u201cExplore.\u201d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-1579 size-large\" src=\"https:\/\/www.cloudsavvyit.com\/thumbcache\/0\/0\/1c4c224635b171485473c7716fea26ee\/p\/uploads\/2019\/08\/efc6b673-1024x730.png\" alt=\"Check the web.config file in the associated website. \" width=\"640\" height=\"456\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>This will bring you to the root directory of your website where you will find a file named web.config. Open this file in Notepad to see it\u2019s contents.<\/p>\n<p>Your web.config should contain the following information somewhere inside its contents:<\/p>\n<blockquote><p>&lt;rewrite&gt;<br \/>&lt;rules&gt;<br \/>&lt;rule name=\u201dHTTPS force\u201d enabled=\u201dtrue\u201d stopProcessing=\u201dtrue\u201d&gt;<br \/>&lt;match url=\u201d(.*)\u201d \/&gt;<br \/>&lt;conditions&gt;<br \/>&lt;add input=\u201d{HTTPS}\u201d pattern=\u201d^OFF$\u201d \/&gt;<br \/>&lt;\/conditions&gt;<br \/>&lt;action type=\u201dRedirect\u201d url=\u201dhttps:\/\/{HTTP_HOST}{REQUEST_URI}\u201d redirectType=\u201dPermanent\u201d \/&gt;<br \/>&lt;\/rule&gt;<br \/>&lt;\/rules&gt;<br \/>&lt;\/rewrite&gt;<\/p>\n<\/blockquote>\n<p>If you do not have a section that says this in your web.config file, add the above code block right before the closing &lt;\/system.webServer&gt; tag and save your file.<\/p>\n<p>You should now be able to access any http URLs on your website and see that they redirect to the secured https URL! Congratulations, all pages on your site and URLs are being redirected to their secure counterpart!\n<\/p><\/div>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong>\n<\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener noreferrer\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/1573\/setting-up-https-redirects-in-iis-and-securing-your-urls\/\" target=\"_blank\" rel=\"noopener noreferrer\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#Setting Up HTTPS Redirects in IIS and Securing Your URLs \u2013 CloudSavvy IT&#8221; In order to force your website to load over SSL, you will likely need to incorporate redirection to push all insecure URLs to their secure counterpart. This is necessary to be sure that all users and pages support and utilize your SSL&#8230;<\/p>\n","protected":false},"author":1,"featured_media":89887,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/09\/6956a5c5.png","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-89886","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/89886","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=89886"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/89886\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/89887"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=89886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=89886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=89886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}