1

I prerender an i18n angular application and i've taught apache to work withouth trailing slashes when a directory is requested.

When i call www.example.com, apache redirects to www.example.com/en and the prerendered page is delivered.

Then angular initializes and adds a trailing slash into the url: www.example.com/en/

How can i prevent angular from adding a trailing slash to my localized url?

repo for reproduce

Edit

this one works: https://github.com/angular/angular/issues/21003#issuecomment-504777969

i just don`t like the "unsure if it breaks anything"

i wonder why i feel so terribly lost with this issue

this is a common requirement having i18n with clean urls

i would have expected, that angular provides a way to handle it, ie. by setting the basehref somehow

funnywise i found a lot of questions in the www asking for adding a trailing slash, but this is not what i understand by "clean urls"

davey
  • 1,666
  • 17
  • 24
  • Checkout my answer here if you're experiencing the 301 redirect issue which this sounds like you are: https://stackoverflow.com/a/73835009/5832236 short answer is upgrade Angular Universal above 11.1 and make sure your server routes all traffic to `main.js` – Eric Belisle Giddings Sep 24 '22 at 05:58

0 Answers0