Skip to content

Instantly share code, notes, and snippets.

@gleox
Created May 9, 2018 03:02
Show Gist options
  • Save gleox/b8890b66915b1ba6e9757e7f316444b2 to your computer and use it in GitHub Desktop.
Save gleox/b8890b66915b1ba6e9757e7f316444b2 to your computer and use it in GitHub Desktop.
A IIS rewrite rule for SPA
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="pages" enabled="true" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="/" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_URI}" matchType="Pattern" pattern="/(api|static)(.*)$" ignoreCase="true" negate="true" />
</conditions>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
<!-- https://gingter.org/2017/03/20/deep-link-angular-spa-iis/ -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment