Skip to content

Angular i18n 404 not found #6489

Locked Answered by BaloJr99
BaloJr99 asked this question in Help
Discussion options

You must be logged in to vote

Finally I was able to fix the issue, I used redirect for changing the main path depending of the user preferred language, then I used rewrite to redirect any request to the depending language dist file, maybe this is usefull for some people but when I tried to reload any page there was a 404 Not Found, so I used the (.) regex in the rewrite source request
{
"redirects": [
{
"source": "/",
"has": [
{
"type": "header",
"key": "Accept-Language",
"value": "(^en.
$)"
}
],
"destination": "/en"
},
{
"source": "/",
"has": [
{
"type": "header",
"key": "Accept-Language",
"value": "(^(?!^en).$)"
}
],
"destination": "/es"
}
],
"rewrites": [
{
"source": "/en/(.
)",
"has": [
{
"type": "header",
"key": "A…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by BaloJr99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
1 participant