Skip to content

Instantly share code, notes, and snippets.

@eaconde
Forked from alexsasharegan/.htaccess
Created March 27, 2019 03:12
Show Gist options
  • Save eaconde/14a71e19d0741bad8b7bf88cb695be26 to your computer and use it in GitHub Desktop.
Save eaconde/14a71e19d0741bad8b7bf88cb695be26 to your computer and use it in GitHub Desktop.
Apache Config for React Router
<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>
@eaconde
Copy link
Author

eaconde commented Mar 27, 2019

Needs:

sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment