Mobile app version of vmapp.org
Login or Join
Cugini213

: IIS 7 Require SSL automatically redirect to https:// I've configured IIS 7 to require SSL. I'm wondering if I can automatically redirect non-ssl requests to be encrypted. For example, if a

@Cugini213

Posted in: #Https #Iis7 #SecurityCertificate

I've configured IIS 7 to require SSL. I'm wondering if I can automatically redirect non-ssl requests to be encrypted.

For example, if a user types in domain.com, can IIS redirect the request to domain.com rather than display the 403 error page?

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Cugini213

3 Comments

Sorted by latest first Latest Oldest Best

 

@Angela700

First, you need to disable 'Require SSL' in SSL Settings. Then you can follow skottt's solution.

BTW, I followed RuslanY Blog's blog ruslany.net/2009/04/10-url-rewriting-tips-and-tricks/

10% popularity Vote Up Vote Down


 

@Goswami781

You could also use UrlRewriter.NET. The rules to use with that, look like this:

<rewriter>
<if header="HTTPS" match="^OFF$">
<redirect url="(.*)" to="https://yourdomain.com"/>
</if>
</rewriter>

10% popularity Vote Up Vote Down


 

@Margaret670

There are a few ways you can do this but if you have the URL Rewrite Module installed, it's fairly easy and a good way to do it.

You can paste the below configuration into your site's web.config file (enclosed in the <system.webServer></system.webServer> section)

<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="https redirect">
<match url="(.*)" ignoreCase="false" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="false" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}{REQUEST_URI}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>


OR you can use the IIS's UI to make a new rule like in the below screenshot.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme