I need to be able to be able to use a URL without a hash in order to implement a redirect for SAML login. So I enabled HTML5 mode in my AngularJS app and set the base href in index.html
. Now the app doesn’t show any hashes when I login.
For example, I get sent to https://myplatform.example.com/logbase/zonesAdmin instead of https://myplatform.example.com/logbase/#/zonesAdmin. At least, that’s what I see in the address bar.
However, if I try to go directly to https://myplatform.example.com/logbase/zonesAdmin, I get a 404 Not Found error.
And if I put the URL that contains the # in the address bar, I get sent to the zonesAdmin page like always.
How can I get my app to accept the non-# URL as a direct link?
So far, I put <base href="/logbase/">
in index.html
and I added $locationProvider.html5Mode({ enabled: true });
to my javascript. That much works.
I also messed around with all combinations of rewriteLinks
and requireBase
in the html5Mode call. Didn’t seem to help.
A lot of the docs I looked at show Apache rewrite rules, but those didn’t work. Not sure if I’m putting them in the right place. We have some complicated proxying going on to sort between a couple of APIs and the logbase frontend.
ogionnj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.