Skip to content

Instantly share code, notes, and snippets.

@mgoku
Last active August 29, 2015 14:06
Show Gist options
  • Save mgoku/6ef5aced65fcc660b28d to your computer and use it in GitHub Desktop.
Save mgoku/6ef5aced65fcc660b28d to your computer and use it in GitHub Desktop.
.htaccess for Angularjs app in html5 mode
# Apache .htaccess
# Thanks to Eric Duran http://ericduran.io/2013/05/31/angular-html5Mode-with-yeoman/
# angularjs pushstate (history) support:
# See http://www.josscrowcroft.com/2012/code/htaccess-for-html5-history-pushstate-url-routing/
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteCond %{REQUEST_URI} !.*\.(css|js|html|png|jpg|ico) #Add extra extensions if needed.
RewriteRule (.*) index.html [L]
</ifModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment