Skip to content

Instantly share code, notes, and snippets.

@rohit-lakhanpal
Created August 11, 2020 12:37
Show Gist options
  • Save rohit-lakhanpal/70ce31a26327f6dd43cd599761f67169 to your computer and use it in GitHub Desktop.
Save rohit-lakhanpal/70ce31a26327f6dd43cd599761f67169 to your computer and use it in GitHub Desktop.
Configuring Azure to reconcile client and server side routing. [In the public folder, let’s add a web.config XML file with the following content:]
<?xml version="1.0"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="React Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment