I have an AngularJS website based on Firebase.
I have managed to remove the #
prefix and reqrite urls like /#/home
to /home
,
using the code below:
.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) {
$routeProvider.otherwise({
redirectTo: '/home'
});
if(window.history && window.history.pushState){
$locationProvider.html5Mode({
enabled: true,
requireBase: false
});
}
}])
however, the existing anchors create problems. When I click on <a href="#/faq">FAQ</a>
, it takes me to /home#%2Ffaq
Of course, I can change the href
of some anchors, but do not see that as a solution, as there might be some links somewhere that remain unchanged and get broken.
How do I resolve this issue without breaking the existing links?