I have html5mode enabled in my AngularJS application so I can access paths with the URL format site.com/path
instead of site.com/#/path
.
But navigation to a hash is not working properly with html5mode enabled. When I navigate to site.com/#hash
through Chrome, the URL automatically changes to site.com/hash
. Since hash
is not a resource on the server, this URL results in the loading of the default index.html file instead of scrolling to the hash
location.
This seems to be a very trivial use case but how can I make the URL format site.com/#hash
work as expected with AngularJS?