Skip to content

Instantly share code, notes, and snippets.

@geraldyeo
Created October 3, 2013 05:28
Show Gist options
  • Save geraldyeo/6805416 to your computer and use it in GitHub Desktop.
Save geraldyeo/6805416 to your computer and use it in GitHub Desktop.
Rules for AngularJS HTML5 Routing
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_URI} !/api
# otherwise forward it to index.html
RewriteRule ^.*$ - [NC,L]
RewriteRule ^app/. /app/index.html [NC,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment