Rewrite URL dynamically adding the locale... #1087
Unanswered
davidlewisbates1980
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm fairly new to all of this, so please be gentle! I've got the following code...
What I'm trying to do is to check whether or not the requested URL is allowed (based on our own feature flag system,
isPageFeatureDisabled(...)
) and, if that page isn't allowed, to send the user the data from/feature-disabled
.I thought that if I just created a new request object and passed it to the localization middleware, it'd automatically add the locale so the page would be displayed in the appropriate language...but this doesn't happen.
If I go to
/fr/page-behind-feature-flag
, I expected the above code to leave the browser URL unchanged, but to show me the text which is returned from/fr/feature-disabled
. However, it instead goes to my default locale and shows me the content from/en/feature-disabled
.What am I forgetting?
Beta Was this translation helpful? Give feedback.
All reactions