iis | seo | web-config | rewrite-rule | aspnet

Redirect HTTPS requests to HTTP using IIS Rewrite rule in Web.Config

Use the provided rewrite rule to redirect HTTPS requests to HTTP.

Abhith Rajan
Abhith RajanSeptember 28, 2017 · 1 min read · Last Updated:

The below-given rewrite rule which redirects all the HTTPS request to its HTTP URL. Redirecting HTTPS to HTTP isn’t recommended considering many factors. If you don’t have SSL purchased for your website, there are some cool options, like Cloudflare, it has a free package where it adds security to your site as well as provides free SSL, will write about it in a separate post.

1<rewrite>
2 <rules>
3 <rule name="Redirect to HTTP" stopProcessing="true">
4 <match url="(.*)" />
5 <conditions>
6 <add input="{HTTPS}" pattern="^ON$" />
7 </conditions>
8 <action type="Redirect" url="http://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
9 </rule>
10 </rules>
11</rewrite>

This page is open source. Noticed a typo? Or something unclear?
Improve this page on GitHub


Abhith Rajan

Written byAbhith Rajan
Abhith Rajan is a software engineer by day and a full-stack developer by night. He's coding for almost a decade now. He codes 🧑‍💻, write ✍️, learn 📖 and advocate 👍.
Connect

Is this page helpful?

Related ArticlesView All

Related StoriesView All

Related Tools & ServicesView All

metatags.io

Meta Tags — Preview, Edit and Generate

With Meta Tags you can edit and experiment with your content then preview how your webpage will look on Google, Facebook, Twitter and more!
en.ryte.com

Robots.txt generator - Create a robots.txt file instantly

Generate a robots.txt file for free with this easy-to-use tool. Make sure search engine crawlers are crawling and indexing your site.