Copied to clipboard

Flag this post as spam?

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


  • Phil Dye 123 posts 217 karma points
    Jan 13, 2012 @ 18:41
    Phil Dye
    0

    Multi-site Page Not Found with single domain name?

    Will this work when using the single-domain name technique for multilingual sites at http://our.umbraco.org/wiki/how-tos/running-multi-lingual-sites-under-a-single-domain?

    I suspect not, since if it relies on ServerVariables["SERVER_NAME"] then that will always be the same regardless of target site.

    Pretty much every technique I've tried so far won't deal with this; ie have /en/deadUrl show /en/error404, and /de/deadUrl show /de/error404, for example.

    Phil

  • Lee Kelleher10666 karma points admin core mvp c-trib
    Jan 15, 2012 @ 08:22
    Lee Kelleher
    1

    Hi Phil,

    When you say using a single-domain, is the domain associated with the root content node? (under the "Manage Hostnames" menu).

    If not, then the "MultiSitePageNotFoundHandler" wont work.  The one you're after is called "SearchForPageNotFound" - it uses the same property alias "umbracoPageNotFound" - so you should only need to change the reference in your "404handlers.config".

    Cheers, Lee.

  • Phil Dye217 karma points
    Jan 16, 2012 @ 09:37
    Phil Dye
    0

    Lee,

    There are hostnames associated with each of the three homepage/root nodes, but those hostnames are not 'real', only used to get locale switching and provide the first part of URLs;

    en.domain.com > /en/
    fr.domain.com > /fr/
    de.domain.com > /de/

    I'll try SearchForPageNotFound and report back...

    Phil

  • Phil Dye217 karma points
    Jan 16, 2012 @ 10:37
    Phil Dye
    0

    Still not working I'm afraid; all incorrect urls are showing the English page, irrespective of the first url segment. For example, /de/foobar?umbDebugShowTrace=true shows the English page, with debug output;

    notFoundHandlerTrying NotFoundHandler 'uComponents.Core.NotFoundHandlers.SearchForPageNotFound'...
    Resolve Urls0
    notFoundHandlerNotFoundHandler 'uComponents.Core.NotFoundHandlers.SearchForPageNotFound found node matching de/foo with id: 1139

    (Node 1139 is the English 404 page)

    I have configured multisite stuff as follows;

    And have setup an umbracoPageNotFound Content Picker as follows, and published each of the three 'root' nodes with a selected page;

    Phil

  • Phil Dye217 karma points
    Jan 16, 2012 @ 10:57
    Phil Dye
    0

    Looking at the source for SearchForPageNotFound, I don't think it will do what's needed anyway; it'll find all nodes with an umbracoPageNotFound property, and simply returns the first (ie the English one in my example above).

    SearchFor404ContentHandler seems closer, but that looks for the 'closest' page (in url) of type ErrorPage?

    Phil

  • Phil Dye217 karma points
    Jan 16, 2012 @ 11:17
    Phil Dye
    101

    FYI, SearchFor404ContentHandler does the job; all I had to do was change the alias of my 404 error page to be ErrorPage, and things work as expected.

    http://www.ridethewaveright.com is the site, if anyone wants to verify this works as I hope ;-)

    Phil

  • Lee Kelleher10666 karma points admin core mvp c-trib
    Jan 16, 2012 @ 11:27
    Lee Kelleher
    0

    Hi Phil,

    Glad that the SearchFor404ContentHandler worked for you ... IMO it would work better if it found nodes with a specific property alias (same as the other ones), instead of searching for the doc-type alias.  But it appears to be working well for you (I tested your link too).  (Disclaimer: I didn't write the 'SearchFor404ContentHandler' code).

    Going forwards, if there are any improvements that you think the other NotFoundHandlers should have, feel free to raise an issue on our CodePlex.

    Cheers, Lee.

Please Sign in or register to post replies

Write your reply to:

Draft
Our.umbraco.org is the community mothership for Umbraco, the open source asp.net cms. With a friendly forum for all your questions, a comprehensive documentation and a ton of packages from the community. This site is running Umbraco version 7.3.0-RC