Skip to content

Instantly share code, notes, and snippets.

@MSerj
Last active May 22, 2018 07:30
Show Gist options
  • Save MSerj/d0830e40fef4607f5606138317280cd9 to your computer and use it in GitHub Desktop.
Save MSerj/d0830e40fef4607f5606138317280cd9 to your computer and use it in GitHub Desktop.
Apache react spa htaccess
RewriteEngine on
RewriteCond %{REQUEST_URI} !\.(?:css|js|jpe?g|gif|png|svg|otf|ttf|woff|woff2|eot|mp4|mpeg|avi)$ [NC]
RewriteRule . /index.html [L]
#OR
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.html [L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment