'Angular router include extra segment to the path when useHash is enabled

I have an angular application deployed under an URL looks like this:

https://example.com/my-angular-application

This is a requirement in my project to use hash routing so I set useHash: true

In case if I start the application and my default route is /abcd I would expect the URL to look like this:

https://example.com/my-angular-application/#/abcd

But instead of this I got:

https://example.com/my-angular-application/#/my-angular-application/abcd

What can cause this behaviour?

I've tried to use redirect to resolve this but it did not help.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source