• Resolved fibronic

    (@fibronic)


    Hi everyone,

    We’re experiencing some issues with the functionality of the TranslatePress plugin:

    We would like the default language of the website to be the non-default language. Therefore, we enabled “Use a subdirectory for the default language” and moved the preferred language to the top of the languages list.

    The website works fine for the non-default (top of the language list) language, but when we switch to the default language, all the hyperlinks are incorrect. For example
    our about page, which has the URL domainname.nl/about-us: if we click on the header menu link to the about page for the non-default language, we get redirected to domainname.nl/nl/about-us, which is what we want. When we do the same for the default language, however, we are navigated to domainname.nl/en/1, instead of domainname.nl/en/about-us. This is true for all our pages, posts and hyperlinks. So basically only the homepage works in the default /en language.

    When we navigate to any default language pages (/en) by directly typing the url: domainname.nl/en/about-us, it works as expected.

    Any help is greatly appreciated!

    Kind regards,
    Frank

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Dragos

    (@dragosvrejiu)

    Hello Frank,

    Thank you for getting in touch with us!

    This is what the “Use subdirectory for the default language” does. It appends the language directory to the default language and allows you to select a different first seen language.

    Best regards,

    Thread Starter fibronic

    (@fibronic)

    Hi Dragos,

    Thanks for taking the time to read and reply to our support request.

    I understand what the functionality of this option is and what it does, that’s why we enabled it. But the issue we are having is that all hyperlinks are broken for the default, English version of the page. I will try to explain the issue we are facing as clear and elaborate as possible:

    Our website has hyperlinks to other pages within the same website. In our header menu, for example, we have links to other pages. Some of the hyperlinks in our header menu have the following URLs set:
    domainname.nl/gallery
    domainname.nl/about-us
    domainname.nl/contact

    Now, like I said before, we enabled the “Use subdirectory for the default language” feature of TranslatePress, and moved the language “Dutch” to the top of the “language list”, because we want visitors of the website to land on the Dutch version of our website by default. This works fine.

    This feature adds either /nl/, for Dutch or /en/, for English, to the URL when we navigate to any page. Sticking to the previous header menu example, when we use the header menu to navigate to another page when on the Dutch version of the website. This is what the URLs look like:
    old: https://domainname.nl/gallery new: https://domainname.nl/nl/gallery
    old: https://domainname.nl/about-us new: https://domainname.nl/nl/about-us
    old: https://domainname.nl/contact new: https://domainname.nl/nl/contact

    This is exactly what we want and all the URLs work as expected.

    For the English version of our website, however, all the URLs are unfortunately broken. Again, sticking to the same example as before. Here’s what the URLs are for the English version of the website:
    old: https://domainname.nl/gallery new: https://domainname.nl/en/1
    old: https://domainname.nl/about-us new: https://domainname.nl/en/1
    old: https://domainname.nl/contact new: https://domainname.nl/en/1

    Obviously, all the hyperlinks for the English version of our website now lead to a non-existing page (404).

    I’ll give another practical step-by-step example just in case there’s any chance of misunderstanding:
    1. We enter the address https://domainname.nl in our browser
    2. We end up at https://domainname.nl/nl (because we set the Dutch version as default in TranslatePress.
    3. While on the Dutch version of our website, we click on the “Gallery” list item in our header menu.
    4. We are navigated to https://domainname.nl/nl/gallery (great)
    5. We go back to the homepage https://domainname.nl/nl
    6. We click on the language switcher and choose the language: English.
    7. We are navigated to https://domainname.nl/en (so far so good)
    8. We click on the “Gallery” list item in our header menu.
    9. We are navigated to https://domainname.nl/en/1 (not so good)

    Any hyperlink we may click while on the English version of our website, we always end up at https://domainname.nl/en/1.

    I hope it’s clear what the issue is now. Again: any help will be greatly appreciated.

    Kind regards,
    Frank

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Default language subdirectory breaks hyperlinks’ is closed to new replies.