Copied to clipboard

Flag this post as spam?

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

  • Alexandre Locas 52 posts 217 karma points
    Jul 08, 2022 @ 11:41
    Alexandre Locas

    Redirects not working correctly (v9.5)

    Hi, any idea why the first redirect is not working (404) but the following are ?

    I know there was a bugfix in 9.3 regarding redirects but I am using 9.5.

    Thank you

    enter image description here

  • Marc Goodson 2046 posts 13490 karma points MVP 8x c-trib
    Jul 11, 2022 @ 08:44
    Marc Goodson

    Hi Alexandre

    It sure feels like it maybe related to that issue...

    Your site has the fr-CA culture as the default culture for the site, and then English alternative in the sub /en folder.

    But like you say when you request /bottin-de-ressources/ there is no attempt at redirecting, which must mean, I think, when the RedirectUrlRepository calls GetMostrecentUrl(string URL, string culture)

    Somehow it is not finding the Url in the umbraco redirects database table, even though it's listing it on the dashboard!

    The bug fix seemed to solve the problem when the Culture in the database table was 'empty' and not NULL, and adds an additional check...

    enter image description here

    So it will be worth looking at the SQL database table, to make sure the culture matches the ones that work... and I guess the other possibility is the UrlHash is not right for that Url...

    How did the redirects end up being created?

    Did the bottin-de-ressources page get renamed to bottin-des-ressources-et-divorce ? and if so how did the child pages underneath bottin-de-ressources end up also getting redirected to that page??



  • Alexandre Locas 52 posts 217 karma points
    Jul 11, 2022 @ 18:29
    Alexandre Locas

    Hi Marc, thanks a lot for your help.

    When looking at the umbracoRedirectUrl SQL table i have noticed something strange : in the url column there is often a numeric (node id) before the redirected url eg : 123/my-old-url but but not always.

    The redirections seems to work where the node id value is present.

    Any idea how this is supposed to work ?

  • Marc Goodson 2046 posts 13490 karma points MVP 8x c-trib
    Jul 11, 2022 @ 20:04
    Marc Goodson

    Hi Alexandre

    The number in front of the Url path correlates to the ID of a content item which has had a culture and hostname set.

    You usually set a culture and hostname by right clicking the home page of the site and choosing 'cultures and hostnames'

    Umbraco can be used to host a single site... In those circumstances you probably don't set a culture and hostname... All requests route directly to the content items in the tree..

    .. But if you have a hostname set anywhere in the site it subtly changes how routing works...

    First umbraco will try to match the hostname of the incoming url to the content item with a matching hostname... Then it will consider that content item to be the root of that site and the Url will only look for matching content below that content item...

    ... To avoid clashes between multiple sites all having an /abour-us url... Umbraco prepend the I'd of the content item with the matching hostname....

    So a route of


    Is the about Us page of the home page with I'd 123

    So do you have any culture and host names set? And have you added them since the redirect got created... ... As if a site didn't have any its redirects wouldn't have the prefix... ... But soon as one is added those prior redirects would be broken...

    Regards Marc

  • Alexandre Locas 52 posts 217 karma points
    Jul 13, 2022 @ 11:26
    Alexandre Locas

    Thanks for your help, I will patch things directly in the SQL table.

Please Sign in or register to post replies

Write your reply to: