I am using AngularJS with ui.router. I have seen a behaviour difference in Hashbang and HTML5 mode and I wonder if it can be changed/prevented.
When using
$locationProvider.html5Mode(true);
a full page reload happens when I manually change the url in the address bar. For example, if I am currently on the url
http://example.com/post/5467777
And manually change it to
http://example.com/post/5464777
a pull page reload happens, and then the correct state is loaded.
If I don't use HTML5 mode, a full page reload doesn't happen, instead the state is directly loaded (which is much faster of course) when changing the url from
http://example.com/#/post/5467777
to a different one. My server-side configuration for HTML5 mode looks as follows:
# 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.php [L]
I thought AngularJS could intercept those URL changes as well. If possible, how can I make my page not reload when manually changing the url in HTML5 mode?
Thanks