Last active
December 28, 2015 19:58
-
-
Save derekmurawsky/7553658 to your computer and use it in GitHub Desktop.
web.config file to redirect to HTTPS, and a subdirectory. Disables HTTPS redirect for remoting layer. Redirects WWW.domain.com to https://domain.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<location path="." inheritInChildApplications="false"> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<clear /> | |
<rule name="Root Hit Redirect" enabled="false" stopProcessing="true"> | |
<match url="^$" /> | |
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" /> | |
<action type="Redirect" url="/home/" /> | |
</rule> | |
<rule name="Redirect www.domain.com to domain.com" patternSyntax="Wildcard" enabled="false" stopProcessing="true"> | |
<match url="*" /> | |
<conditions> | |
<add input="{HTTP_HOST}" pattern="www.domain.com" /> | |
</conditions> | |
<action type="Redirect" url="domain.com/{R:0}" /> | |
</rule> | |
<rule name="Remoting Bypass" enabled="false" patternSyntax="Wildcard" stopProcessing="true"> | |
<match url="*Remoting*" /> | |
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" /> | |
<action type="None" /> | |
</rule> | |
<rule name="HTTP to HTTPS redirect" enabled="false" stopProcessing="true"> | |
<match url="(.*)" /> | |
<conditions logicalGrouping="MatchAll" trackAllCaptures="false"> | |
<add input="{HTTPS}" pattern="off" ignoreCase="true" /> | |
</conditions> | |
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Found" /> | |
</rule> | |
</rules> | |
</rewrite> | |
</system.webServer> | |
</location> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Switched all rules to disabled by default. Better for initial deployments.