0

Good evening, I've created a fair amount of url's by using ui-router inside my AngularJS application. I've delivered this to my employer and they're using an external service (bit.ly) to shorten this dynamic url's.

Now here's the thing: my url's have the following structure: https://myurl/prices/#/data?id=1

Once they have been shortened and you click on them, most of the URI gets lost. To make this long story short: you get something like this: https://myurl/prices/#

And that's it.

Any ideas?

Thanks in advance, by the way.

Jose Peres
  • 197
  • 1
  • 1
  • 18
  • It looks like bit.ly is removing everything after the hash. Have you considered using HTML5 mode and URL rewriting to remove the hash from your URLs? – Lex Apr 29 '19 at 15:01
  • It seems to work! The only problem comes when refreshing the page. I've been trying with the usual IIS rewrite but I think the problem is that my "base href" is "/prices/" and not only "/". So, when refreshing, I'm still getting that annoying 404. – Jose Peres Apr 29 '19 at 16:05
  • Can you share your URL rewriting rules (maybe update the original question with that info)? The 404 is usually because the server is not redirecting properly and trying to actually load a page that doesn't exist. – Lex Apr 29 '19 at 16:27
  • Sure. Here it is: – Jose Peres Apr 29 '19 at 16:36
  • It looks like you're rewriting to `/`. Don't you need to rewrite to `/prices/`? Note: I have never used a non-standard base href so this is a total WAG. – Lex Apr 29 '19 at 16:48
  • That won't work. I tried something like: But no... – Jose Peres Apr 29 '19 at 19:21
  • Well that's a bummer. There's got to be a way to do it. Have you looked at [this question](https://stackoverflow.com/questions/44271461/angularjs-routing-404-error-with-html5-mode)? – Lex Apr 29 '19 at 19:23

0 Answers0