Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Web Server » URL Rewrite: How to redirect from HTTP to HTTPS
  • azure sql featured image
    How to delete ADFS Windows Internal Database without access credentials Oracle/MSSQL/MySQL
  • Banner
    How to Scan Your Code by Integrating SonarCloud into Your GitHub Repository Security | Vulnerability Scans and Assessment
  • Featured image 4
    Focus on Tasks: Limit Distraction & Get Things Done on Windows Windows
  • Group Policy Error
    How to Fix Failed to open the Group Policy Object on this Computer Windows
  • Install error 0x800700b7
    How to fix Windows update Install error 0x800700b7 Windows
  • 2019Blacklist Blog
    How does IP Address or Domain blacklist work? Network | Monitoring
  • image 23
    Copy Deployment Share between Servers without using linked Deployment Shares Windows
  • discorddd
    Discord Installation Guide for Linux System Linux

URL Rewrite: How to redirect from HTTP to HTTPS

Posted on 13/08/201920/09/2023 Christian By Christian No Comments on URL Rewrite: How to redirect from HTTP to HTTPS
How to perform redirection from HTTP to HTTPS

IIS URL Rewrite enables Web administrators to create powerful rules to implement URLs that are easier for users to remember and easier for search engines to find. By using rule templates, rewrite maps, .NET providers, and other functionality integrated into IIS Manager, Web administrators can easily set up rules to define URL rewriting behavior based on HTTP headers, HTTP response or request headers, IIS server variables, and even complex programmatic rules. In addition, Web administrators can perform redirects, send custom responses, or stop HTTP requests based on the logic expressed in the rewrite rules.

Please see the following interesting articles on how to import a certificate into the Trusted Root and Personal file certificate store, how to request a certificate signing request in Windows using Microsoft Management Console, and how to export a certificate in PFX format in Windows. You may also be interested in this guide: How to install and configure Active Directory Certificate Services.

Without having a valid certificate from a trusted CA, when a user enters the servername (short name) such as "https://server1" instead of "https://server1.techdirectarch.com", the certificate will come as invalid. To resolve this issue, we will use the IIS URL Rewrite. URL Rewrite can also be used to direct users to the HTTPS site, instead of using HTTP.

Configure HTTP to HTTPS Redirection

Firstly,  I had to change the default port from 80 to 81. This is because HTTP listens on port 80 (You may ignore this step if you want). Also, I created a record in the host file to redirect traffic from the localhost/loopback address to 127.0.0.1 – You can do this in DNS too but I decided to use the host file. You can find it in the path as shown below

C:WindowsSystem32driversetc 

Upon entering the IP or hostname, you will be automatically redirected to the desired URL. Additionally, to ensure you can make changes effectively, it’s advisable to open the host file with elevated rights. You can achieve this by running Notepad as an Administrator and then opening the mentioned path. This approach simplifies the process of saving any changes.

127.0.0.1      mk.chris.com
1x.xx.xx.2     mk.chris.com

Note: To make this possible ensure you uncheck the SSL setting to not require certificate otherwise you will never be able to access it via HTTP.

  • Click on the website and
  • Navigate to the SSL Settings
  • Double click to open and set as shown below
SSL Settings

After that, create a binding to allow HTTP connection for the website as shown below.

Create a Binding

Also, to ensure the URL redirect works by redirecting to HTTPS, kindly follow these steps as shown below

  • Under sites, select the desired website
  • Click on URL rewrite (if you do not have this already installed, click on the web Platform Installer, run it and select URL rewrite to install).
  • Click on Add Rule (Under Action)
Clcik on Add Rules
  • The Add Rule URL Opens up
  • Enter any desired name to identify your rule
  • Under the Match URL, enter matches the pattern
  • Under “Using”, select Regular expression
  • Under Pattern, select (.*)
  • Select ignore cases, note: this is selected by default in most cases.
Match URL
  • Navigate to condition and click on “Add” to create a rule
  • Set as shown below and click on Okay
Edit COndition
  • Under Actions “Action type”, select Redirect
    Enter the Redirect URL and the
  • Redirect type as “Found (302)”
Action type: Redirect

Finally, click on apply on the top right side of the screen.

I hope you found this blog post on How to perform redirection from HTTP to HTTPS helpful. If you have any questions, please let me know in the comment session.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
Web Server Tags:IIS, Internet Information Services

Post navigation

Previous Post: Stop Apps from running automatically on MAC
Next Post: How to install Pleasant Password Server

Related Posts

  • Amazon EC2 and S3
    How to sync S3 Bucket with an EC2 instance AWS/Azure/OpenShift
  • tuning tomcat
    How to upgrade Apache Tomcat from One Version to another Web Server
  • 111615smarthomeNG
    Unspecified GSS failure: How to fix Clock skew too great Web Server
  • Setup FSx File System 1
    Create and mount FSx File System: Join EC2 instance to AWS Managed AD AWS/Azure/OpenShift
  • Azure DevOps Server
    How to Install Azure DevOps Server 2022 Automation
  • Azure VM Creation With CLI 1
    Deploy a Linux virtual machine (VM) on Azure using the Azure CLI AWS/Azure/OpenShift

More Related Articles

Amazon EC2 and S3 How to sync S3 Bucket with an EC2 instance AWS/Azure/OpenShift
tuning tomcat How to upgrade Apache Tomcat from One Version to another Web Server
111615smarthomeNG Unspecified GSS failure: How to fix Clock skew too great Web Server
Setup FSx File System 1 Create and mount FSx File System: Join EC2 instance to AWS Managed AD AWS/Azure/OpenShift
Azure DevOps Server How to Install Azure DevOps Server 2022 Automation
Azure VM Creation With CLI 1 Deploy a Linux virtual machine (VM) on Azure using the Azure CLI AWS/Azure/OpenShift

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a
 
  • azure sql featured image
    How to delete ADFS Windows Internal Database without access credentials Oracle/MSSQL/MySQL
  • Banner
    How to Scan Your Code by Integrating SonarCloud into Your GitHub Repository Security | Vulnerability Scans and Assessment
  • Featured image 4
    Focus on Tasks: Limit Distraction & Get Things Done on Windows Windows
  • Group Policy Error
    How to Fix Failed to open the Group Policy Object on this Computer Windows
  • Install error 0x800700b7
    How to fix Windows update Install error 0x800700b7 Windows
  • 2019Blacklist Blog
    How does IP Address or Domain blacklist work? Network | Monitoring
  • image 23
    Copy Deployment Share between Servers without using linked Deployment Shares Windows
  • discorddd
    Discord Installation Guide for Linux System Linux

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,841 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.