1

I'm working on an angular application that has been around for a while.
So far I've used the normal # mode, without any prefix.
The application has quite some content so some of the customers might have bookmarked them (with the hash url schema).

Now I'd like to switch to html5Mode but keep compatibility with the old url schema.
I mean, for example if I previously had this url www.mysite.com/#/action/content?param1=A&param2=B in html5mode it will be www.mysite.com/action/content?param1=A&param2=B.

What I want is: if any user knows the old url (with the #) and he uses it in his browser I'd want my application to be smart and redirect the user to the correct page using the new html5Mode url or keep on using the the old url if the browser doesn't support the new html5Mode.

Is this possible?

(I'm using ui-router)

1

1 Answer 1

1

One possible way what i can think of is that when the page loads and when you are about to set the html5 mode in the angular check for the hash value in the url and if it is present then simply set it to false and vice versa

Sign up to request clarification or add additional context in comments.

1 Comment

any practical example/implementation?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.