Is it possible to prepend the domain to relative pathnames? #1318
Unanswered
astrodomas
asked this question in
Q&A
Replies: 1 comment 11 replies
-
This could work for you: <Link href={{pathname: '/about', host: 'mydomain.com'}}>
About
</Link> |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Is there an easy way to prepend the given
domain name
to the app router next-intlLink
component?I want to display the link
hrefs
as absolute url's.Writing a wrapper function requires effort, as it needs to be implemented in client-side and server-side components separately to use
next-intl
provided functions for respective components.If it is not possible, as
next-intl
already handles prepending the correctlocale
to the pathname, would it make sense to extend the feature so that the developer would be able to prepend the given domain name?current:
<a href="/en/pathname" />
expected:
<a href="https://mydomain.com/en/pathname" />
Beta Was this translation helpful? Give feedback.
All reactions