Skip to content

Instantly share code, notes, and snippets.

@resting
Created July 5, 2024 08:33
Show Gist options
  • Save resting/7c64da49cf7a2a6210ee2c46293b7de9 to your computer and use it in GitHub Desktop.
Save resting/7c64da49cf7a2a6210ee2c46293b7de9 to your computer and use it in GitHub Desktop.
web.config react router
<?xml version="1.0" encoding="UTF-8"?>
<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" />
</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