Created
September 9, 2014 07:19
-
-
Save jbutko/6b500210b4c6811bca54 to your computer and use it in GitHub Desktop.
.htaccess, #AngularJS, UI-Router: Configure Apache server to work with html5Mode
This file contains hidden or 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
# this ensures support for pretty links even after page refresh (F5) | |
<IfModule mod_rewrite.c> | |
Options +FollowSymlinks | |
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> | |
# via https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#how-to-configure-your-server-to-work-with-html5mode |
Need Help!!
On refreshing pages " localhost/blog/list " or opening pages "localhost/blog/" does not work while links like "localhost/blog" open even on refreshing.
To those still facing this problem, it's more common now to use the FallbackResource
directive instead of adding a mod_rewrite block. Read more here.
This works perfectly, but in child routing, it throughs errors,
"Uncaught SyntaxError: Unexpected token"
and page doesn't get loaded.
Need help on this
I am also having the same problem.
Ever since I turned on the html5 mode, all emails links and forced browser reloads are breaking.
Any help how to overcome this scenario?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I am also getting the same problem. If I refresh http://anaoh.com/home, It shows the directory index.
Please let me know if you have any suggestion.
Raja K