Support » Plugin: Multisite Language Switcher » Same post ID’s generate 404 Links

  • Hi,
    first of all thanks for developing and maintain this plugin.

    Currently on the page where I am working the plugin is generating 404 URLs for posts with ID equal to the current post, as you can see in the example page (https://www.bonus.net/no/casino-bonus) the plugin generated 404 URLs for DE and CA. (In the backend the relations are well configured)

    <link rel=”alternate” hreflang=”de-de” href=”https://www.bonus.net/casino-bonus” title=”de_DE”>
    <link rel=”alternate” hreflang=”en-ca” href=”https://www.bonus.net/ca/casino-bonus” title=”en_CA”>

    The proper URLs should be:

    <link rel=”alternate” hreflang=”de-de” href=”https://www.bonus.net/casino” title=”de_DE”>
    <link rel=”alternate” hreflang=”en-ca” href=”https://www.bonus.net/ca/casino” title=”en_CA”>

    Thanks in advance for your help.

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Dennis Ploetner

    (@realloc)

    If I go to https://www.bonus.net/no/casino I see that there is a redirect to https://www.bonus.net/no/casino-bonus. Why is that? Is this a configured redirection? Or is this just a permalinks-issue?

    Hi Dennis,
    it is a configured redirection.

    Plugin Author Dennis Ploetner

    (@realloc)

    The switcher uses core functions like get_permalink() to create the link. The redirection should remain like it is but the post’s slug should be corrected.

    Hi,

    yes, you’re right the plugin uses get_permalink but is fetching the wrong post, because multiple posts have the same ID. The post’s slugs are properly configured.

    Plugin Author Dennis Ploetner

    (@realloc)

    That’s a bit unlikely 😉 … Every post should have it’s own ID in it’s site, there is no “configured” slug since this is a post (or page). Please go to the specific post and double check this!

    Hi Dennis,

    yes, they have the same ID but in different sites. If you check the page again (https://www.bonus.net/no/casino-bonus) you can see that the link generated for the Spanish version is correct because is the only related page that in its own site doesn’t have the same ID that the other pages.

    <link rel=”alternate” hreflang=”es-es” href=”https://www.bonus.net/es/casino” title=”es_ES”>

    You can check the ID of the other pages in the body element, it will be always 7824

    What I mean with the “configured” slugs is that the permalinks and slugs are ok. I already double check.

    Btw thanks for your quick answer.

    Plugin Author Dennis Ploetner

    (@realloc)

    The Switcher saves the IDs (not a link) of the pages in a post_meta. It will update all posts and the post_metas after a click on a save-button in the editor. The link will be built at runtime. That’s why I said it use get_permalink iterating of the sites.

    Check, please…

    1. Save that post
    2. Deactivate the redirection
    3. Check the generated links

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.