Copied to clipboard

Flag this post as spam?

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


  • Mark Gil Libres 24 posts 113 karma points
    May 27, 2015 @ 14:22
    Mark Gil Libres
    0

    Generic 404

    how can I setup a generic 404 rule? a rule that will apply if all the other existing rules do not match

  • Urvish 252 posts 772 karma points
    May 27, 2015 @ 14:28
    Urvish
    0

    Hi Mark,

    You can add 404 page in /config/umbracosettings.config file.

    Check below link fro reference.

    https://our.umbraco.org/wiki/install-and-setup/configuring-404-pages

    Or else you can also set rule in web.config file under system.web section.

    <customErrors mode="Off" defaultRedirect="~/error404.aspx" />
    

    Hope this will help.

    Regards,

    Urvish Mandaliya

  • Mark Gil Libres 24 posts 113 karma points
    May 27, 2015 @ 14:34
    Mark Gil Libres
    0

    Hi Urvish,

    I would still want to use URLTracker for this case.

    Say for example, under www.domain1.com, I would create a rule under URLTracker for Generic 404 = /custom404page. If I request "/page1" and no rules matched with it, then URLTracker will redirect the user to the Generic 404 page.

    Since this is a multi-site & multi-language installation, I'd rather have it on URLTracker to easily update the rules as the business logic changes.

    and besides, it would be marketing people to update the rules on URLTracker, so updating the config is not an option for us.

    Regards, markg

  • Urvish 252 posts 772 karma points
    May 27, 2015 @ 14:43
    Urvish
    0

    Hi Mark,

    I must admit that i haven't use URLTracker package.

    But for the 404 redirection you can go by the above way.

    I have checked this package , as per my understanding this package gives facility to redirect 301 and 302.

    So for 404 you need to write in umbracosettings.config.

    Regards,

    Urvish Mandaliya

  • Stefan Kip 1606 posts 4098 karma points c-trib
    May 27, 2015 @ 14:53
    Stefan Kip
    0

    The Url Tracker hasn't been built/designed to do 404 handling. Use ASP.NET/umbraco's mechanism(s) to do this.

  • Urvish 252 posts 772 karma points
    May 27, 2015 @ 15:01
    Urvish
    0

    Thanks kipusoep for making it clear to me.

    @Mark : You can use one of the above method to set 404.

  • Mark Gil Libres 24 posts 113 karma points
    May 27, 2015 @ 15:10
    Mark Gil Libres
    0

    Hi Kip,

    Yep, we used your URLTracker as well as created our custom handler and updated 404handlers.config to:

    <notFound assembly="umbraco" type="handle404"/>
    <notFound assembly="MyAssembly" type="NotFoundHandler" />
    

    However, when rules are not met on URLTracker, it goes off to the default route for Umbraco 404. But if we re-arranged the order of 404handlers.config to:

    <notFound assembly="MyAssembly" type="NotFoundHandler" />
    <notFound assembly="umbraco" type="handle404"/>
    

    Then it worked, but the URLTracker will not be executed.

    Regards, markg

  • Stefan Kip 1606 posts 4098 karma points c-trib
    May 27, 2015 @ 15:13
    Stefan Kip
    0

    That's probably because your NotFoundHandler doesn't leave the HTTP status set to 404?

  • Mark Gil Libres 24 posts 113 karma points
    May 27, 2015 @ 15:30
    Mark Gil Libres
    0

    basically this is what we want to happen:

    URLTracker (301 & 302) -> NotFoundHandler -> default 404.

    If the NotFoundHandler does not see any custom 404 page selected, then it should display the default 404.

    but I think this has something to do with Umbraco version. This behaviour worked on our local machine having Umbraco 7.2.4, while this behaviour doesn't worked on Umbraco 7.2.1

    Will try to update our live version and hopefully it will work. :)

  • 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