Genererate a full qualified url with getPathname
and a domain based routing
#1918
Unanswered
armandabric
asked this question in
Q&A
Replies: 1 comment
-
You can just concatenate the domain with your pathname as shown in the sitemap example. I'll move this to a discussion since it seems to be a usage question. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Is your feature request related to a problem? Please describe.
When working with an external service, I need to give him some return url / callback. I use the
getPathname({ href: "/cart", locale: "fr" })
to generate the localized path.I use domain based localisation, but I did not find a way to generate the path with it's subdomain.
Here my configuration:
Describe the solution you'd like
Add an option to generate the pathname with the good domain:
forceDomain: true
. Or create a new functiongetUrl({ href: "/cart", locale: "fr", protocol: "https"})
.Describe alternatives you've considered
I have try to use the
forcePrefix
option:getPathname({ href: "/cart", locale: "fr", forcePrefix: true })
but it only add a locale prefix but no domain:/fr/mon-panier
.Beta Was this translation helpful? Give feedback.
All reactions