1

I need to preserve the index.html and query params in URL as it is. But when default route is loaded, they are removed and the default route is added with '#'. Is there any way to keep index and query params permenantly on URL.

  • Can you explain the scenario in detail – Chris Jun 18 '19 at 11:49
  • Let's assume I use "http://localhost:4200/index.html?name=max&id=085" . My default route is 'session'. When I launch the application, URL is updated to "http://localhost:4200/#/session". But I want to preserve it like "http://localhost:4200/index.html?name=max&id=085#session". Is there any way to achieve this? – user3679264 Jun 18 '19 at 12:26
  • This may be useful : https://stackoverflow.com/questions/36985572/how-to-define-default-route-with-parameters-in-angular-component-router – Chris Jun 19 '19 at 05:27
  • 1
    Does this answer your question? [Angular 2\4 hash url keep index.html](https://stackoverflow.com/questions/44615646/angular-2-4-hash-url-keep-index-html) – TylerH Jan 25 '23 at 15:13

1 Answers1

0

Update the base tag to something like:

<base href="./index.html" />
chrismarx
  • 11,488
  • 9
  • 84
  • 97