Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Dec 20, 2023 @ 14:38
    Alex Skrypnyk
    0

    Umbraco rel="canonical" and rel="alternate"

    Hi, community,

    Can somebody share code snippets for canonical and alternate tags for Umbraco solutions with many cultures and redirects?

    Thanks,

    Alex

  • Anders Bjerner 487 posts 2996 karma points MVP 8x admin c-trib
    Dec 21, 2023 @ 09:56
    Anders Bjerner
    100

    Hi Alex

    I feel like this is a question that may need a bit more context.

    For the canonical URL, I'd say it should be something like this in most cases:

    <link rel="canonical" href="@Model.Url(mode: UrlMode.Absolute)" />
    

    If you're doing something extra - eg. making content appears at other URLs - you may have to change accordingly. Of maybe not - if the original URL is still accessible.

    What purpose would the alternative links have? If you're doing a culture variant site, you may be able to iterate through the available cultures, and then add an alternative link for each culture - except the current culture.

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Jan 12, 2024 @ 16:59
    Alex Skrypnyk
    0

    Thank you so much, it's resolved

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies