Last active
February 16, 2021 15:46
-
-
Save loursbourg/f7b082cd05e1e1d39094e227fc380e00 to your computer and use it in GitHub Desktop.
Apache .htaccess config for a React app with Laravel backend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assuming that your build lives in public/app/ | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase /app/ | |
RewriteRule ^index\.html$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-l | |
RewriteRule . /app/index.html [L] | |
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
# SPA | |
# Assuming that your build lives in public/app/ | |
# ... add this line to /path/to/vhost.conf | |
<Directory "/path/to/public/app"> | |
AllowOverride All | |
</Directory> | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment