Redirect root to AssertWeb and http to https
It is commonly appreciated that:
- root URL is automatically redirected to /AssertWeb/ to make it easier for end users.
- http requests are automatically redirected to secure https requests
It is possible to create a redirect of www.domain.com to www.domain.com/AssertWeb/ by
- Install x64 version of URL -rewrite from Microsoft: https://www.iis.net/downloads/microsoft/url-rewrite
- altering web.config at root, see below
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <clear /> <rule name="Redirect to HTTPS" patternSyntax="ECMAScript" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAny" trackAllCaptures="false"> <add input="{HTTPS}" pattern="^OFF$" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" /> </rule> <rule name="Root Hit Redirect" stopProcessing="true"> <match url="^$" /> <action type="Redirect" url="/AssertWeb/" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
Related articles