Copied to clipboard

Flag this post as spam?

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


  • Lazau Florin 74 posts 210 karma points
    Jun 29, 2017 @ 10:36
    Lazau Florin
    0

    umbracoUrlAlias redirect to original page

    Hi team,

    I' using umbracoUrlAlias in my project.

    Let's say that I have a page:

    /mysamplepage
    

    For this page I set a umbracoUrlAlias as:

    alternativeurl
    

    If I acces /alternativeurl I would like to be redirected to /mysamplepage

    Is this possible? right now I see the page from /mysamplepage but the URL from browser is /alternativeurl

    I need this because in Google Analitycs I see two different pages and I would like to see only /mysamplepage

    Thanks, Florin

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Jun 29, 2017 @ 19:46
    Marc Goodson
    0

    Hi Florin

    umbracoUrlAlias is designed to allow you to have multiple urls listed for a particular page, you just add a comma separated list of 'alias' urls.

    However Umbraco just allows the underlying content to be loaded at the 'alias' url - it returns a 200 code, and does not perform a redirect to the original url.

    If you concern for this is google ranking problems, eg the same content being served on different urls - the consider adding a <link rel="canonical" (canonical link) to the head section of your template pointing to the one true best url for this page, search engines will then amalgamate ranking for all urls that point to the content underneath the canonical one and you won't be penalised.

    If you want an actual 'redirect' from one Umbraco node to another to take place - eg effectively creating a dummy node to just serve as the redirect you can use a special property called umbracoRedirect (that you use with a content picker) to perform a redirect when that node is visited - however this will only issue a 302 temporarily moved redirect.

    To issue a 301 moved permanently redirect, you can use a package such as https://our.umbraco.org/projects/developer-tools/301-url-tracker/

    or create your own redirect document type, and create your own code to perform the 301 redirect, in a template or controller, when that node is requested, having the target redirect url as a property of the 'redirect' doc type.

    regards

    Marc

  • Carlos Mosqueda 240 posts 431 karma points
    May 04, 2020 @ 19:02
    Carlos Mosqueda
    0

    I was looking at the same thing. Of course we have multiple authors who don't keep track of their alternate URLs so Google Analytics and page tracking becomes a bit of a nightmare tracking everything down in a 300 plus page website.

    Is there a way to export all the alias usages per page? Something like a CSV or Excel file export for all the umbracoUrlAlias property usages per page?

  • Amir Khan 1282 posts 2739 karma points
    May 04, 2020 @ 20:33
    Amir Khan
    0

    You could do that with a template and loop through every page of the site and format it however you want, CSV, HTML table, etc.

    We do it for page audits somewhat often.

    Hope that helps.

Please Sign in or register to post replies

Write your reply to:

Draft