Skip to content

Instantly share code, notes, and snippets.

@otaviocorrea
Last active May 24, 2020 21:49
Show Gist options
  • Save otaviocorrea/bd7bd221bb44e5a9200b7de3b2d052e5 to your computer and use it in GitHub Desktop.
Save otaviocorrea/bd7bd221bb44e5a9200b7de3b2d052e5 to your computer and use it in GitHub Desktop.
Utilizar rotas do Build do React em servidor Apache ou IIS
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.html" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
<system.web>
<customErrors mode="On" />
</system.web>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment