Skip to content

Instantly share code, notes, and snippets.

@kareemkibue
Forked from jxnblk/.htaccess
Last active July 26, 2016 01:14
Show Gist options
  • Save kareemkibue/dff73d38f16e2aa2fe21 to your computer and use it in GitHub Desktop.
Save kareemkibue/dff73d38f16e2aa2fe21 to your computer and use it in GitHub Desktop.
.htaccess required for Angular JS HTML5 Mode, Routing (Pretty URLs)
#REQUIREMENTS
# 1. <base href="/" > inside <head> before importing external (local) stylesheets and javascript files
# the above is required if deep linking
#
# 2. in the module configuration, set html5mode to TRUE i.e. $locationProvider.html5Mode(true).hashPrefix('!');
#BEGIN
Options +FollowSymLinks
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteRule (.*) index.html [L]
</ifModule>
#END
@MilosFe
Copy link

MilosFe commented Nov 8, 2015

Can you tell me why is it when I'm writing with http://myapp.com/?_escaped_fragment_/about i get
http://myapp.com/?_escaped_fragment_%2Fabout? Is there any rewrite rule so i can get clean url like http://myapp.com/about

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment