Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Language code duplication in URL causes error page redirection #20

@TobeyEh

Description

@TobeyEh

Hi there! I ran into an issue with the router when setting up a multi-language site.

When pointing a link from a non-top-level url to a top-level url it redirects to the error page. This is because it appends the language code twice.

<router-link  
    :key="contact.uri"
    :to="`/${contact.uri}`"
>

or using a hardcoded path

<router-link  
    :key="contact.uri"
    :to="{path: '/contact'}"
>

or using "../"

<router-link  
    :key="contact.uri"
    :to="{path: '../contact'}"
>

So when you're on www.example.com/en/projects/house
and from there want to link to www.example.com/en/contact
it redirects to www.example.com/en/en/contact and thus goes to the error page.

Does it have something to do with the base url being built with the languageCode inside the router js file?

Thanks for any input!

Edit NOTE:
This only happens when deployed, it doesn't happen on localhost dev. (Maybe a Vite thing?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions