Skip to content

Instantly share code, notes, and snippets.

@EdgarValfogo
Created May 30, 2019 16:56
Show Gist options
  • Save EdgarValfogo/03d38933ffaebb6c6b7ce5f55d5dea15 to your computer and use it in GitHub Desktop.
Save EdgarValfogo/03d38933ffaebb6c6b7ce5f55d5dea15 to your computer and use it in GitHub Desktop.
Web config for angular deployment on IIS
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect to https" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
</rule>
<rule name="Angular Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="./index.html" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment