Skip to content

Instantly share code, notes, and snippets.

@javierojeda94
Last active December 6, 2018 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javierojeda94/1e44a01f3aada6b35078114b2e0bda62 to your computer and use it in GitHub Desktop.
Save javierojeda94/1e44a01f3aada6b35078114b2e0bda62 to your computer and use it in GitHub Desktop.
This .htaccess allows a user to refresh the angular app without getting into 404 and without the need to use # routes
<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