Reputation: 24825
I am trying to change
http://domain.co.uk/#!/pagename
to
http://domain.co.uk/pagename
I was thinking of going URL re-write and then realised that as it is a single page website this will not work, so I am stuck!
Is there a way to do it given existing code-base (a quick javascript function?) or is it just something I have to live with?
! am guessing the latter (well could change to domain.co.uk#pagename I suppose) but am happy to be proved wrong!
Upvotes: 0
Views: 78
Reputation: 943563
The basics are simple enough:
if (location.hash && (location.hash.substr(1,1) === "!")) {
location.replace(location.toString().replace('#!', "/"));
};
You just need to make sure that the new URLs work first.
That means:
Upvotes: 1