I am currently developing a single page application on Salesforce. I have used ngRoute to navigate the user through the website. I've created a visualforce page and immidietly ran into a problem - on localhost when I had:
<a href="/home">Home</a>
it worked as expected, but when I deployed it to the salesforce clicking on the link actually went to /home and threw an 404.
The workaround I found was to make a helper function:
$scope.goto = function (path)
{
$location.path(path);
};
and rework links to:
<a href="#" ng-click="goto('/home')">Home</a>
And it loads content into ngView just fine, BUT it does not change the URL address. On localhost, even with this workaround, it changes to localhost/xyz/home, but on salesforce it does not.
My base tags are set to /xyz/on localhost and to / on salesforce.
Also is there a way to implement ".htaccess" on Salesforce? On localhost I've made a rule to redirect all requests below xyz/ to index.html (so that when user is on /contant page they can refresh the link and not get a 404 error; or can copy the link and their friends can use it) but how can you achive this result on salesforce?
Every answer will be much appreciated. Thank you for the response in advance.
Best,
Mariusz