DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • All About GPU Threads, Warps, and Wavefronts
  • DataWeave: Play With Dates (Part 1)
  • Tired of Messy Code? Master the Art of Writing Clean Codebases
  • The Long Road to Java Virtual Threads

Trending

  • Start Coding With Google Cloud Workstations
  • Measuring the Impact of AI on Software Engineering Productivity
  • How Large Tech Companies Architect Resilient Systems for Millions of Users
  • Artificial Intelligence, Real Consequences: Balancing Good vs Evil AI [Infographic]
  1. DZone
  2. Data Engineering
  3. Data
  4. How to Set Up HTTP/HTTPS Redirection in IIS

How to Set Up HTTP/HTTPS Redirection in IIS

Want to learn more about how to set up HTTP and HTTPS? Check out this tutorial on setting up HTTP and HTTPS redirection in IIS.

By 
S.Prakash Chowdhry user avatar
S.Prakash Chowdhry
·
Oct. 14, 18 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
30.7K Views

Join the DZone community and get the full member experience.

Join For Free

Before you can set out with an HTTP/HTTPS redirect in IIS, you’ll need to make sure that you have an SSL certificate already installed. This is not a step you can skip. Once you’ve got the certificate installed, we can start working on a URL rewrite to redirect your traffic to your new-fangled HTTPS site.

Let’s Get Started

1. Download and install the IIS URL Rewrite Module

2. Open IIS Manager and, in the console, select the website you want to redirect

3. Select URL Rewrite

4. Click Add Rules

5. Select Blank Rule, click OK

6. Enter the Name of rule

7. In the Match URL section, choose “Matches the Pattern” in the Requested URL drop-down

8. Next, select “Regular Expressions” in the Using drop-down

9. In the Match URL section, enter: “(.*)”

10. In the conditions section, select Match All under Logical Grouping, then click Add

11. In the next window:

  • Enter {HTTPS} as the condition input
  • Select “Matches and Pattern” from the drop-down
  • Enter ^OFF$ as the pattern
  • Click OK

12. In the Action section, click Redirect and then specify the Redirect URL as https://{HTTP_HOST}/{R:1}

13. Check the Append Query String box

14. Choose your redirection type (301)

15. Click Apply

Apply the Rule to Your Website

1. In the IIS dashboard, right click on your site and select Explore

2. Your Root Directory will open — select the web.config file and open it

3. Make sure the file contains the following code block (if not, add it):

<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=”HTTPS force” enabled=”true” stopProcessing=”true”>
<match url=”(.*)” />
<conditions>
<add input=”{HTTPS}” pattern=”^OFF$” />
</conditions>
<action type=”Redirect” url=”https://{HTTP_HOST}/{R:1}” redirectType=”Permanent” />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>


4. If you have a web.config file in your root directory, create a new .txt file and place the above code in it, save and then rename the file to web.config.

Hope this helps!

Rewrite (programming) Directory Console (video game CLI) Blank (solution) Strings Blocks Data Types HTTPS

Published at DZone with permission of S.Prakash Chowdhry. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • All About GPU Threads, Warps, and Wavefronts
  • DataWeave: Play With Dates (Part 1)
  • Tired of Messy Code? Master the Art of Writing Clean Codebases
  • The Long Road to Java Virtual Threads

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!