Created
May 19, 2020 11:03
-
-
Save dvdopi/b6af5b8c5230e7bb2677703886a8f92f to your computer and use it in GitHub Desktop.
Angular htaccess that eliminates 404 on page refresh or when accessing inner links
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
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
# Don't rewrite files or directories | |
RewriteCond %{REQUEST_FILENAME} -f [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^ - [L] | |
# Rewrite everything else to index.html | |
# to allow html5 state links | |
RewriteRule ^ index.html [L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment