x First time here? Check out the FAQ
  • Avatar115posts209karma

    Multi-site Page Not Found with single domain name?

    Phil Dye started this topic January 13, 2012 @ 06:41, Go directly to the topic solution

    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 Kelleher posted this reply January 15, 2012 @ 08:22

    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.


  • Avatar115posts209karma
    Comment with ID: 103377
    Phil Dye posted this reply January 16, 2012 @ 09:37

    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


  • Avatar115posts209karma
    Comment with ID: 103392
    Phil Dye posted this reply January 16, 2012 @ 10:37

    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


  • Avatar115posts209karma
    Comment with ID: 103416
    Phil Dye posted this reply January 16, 2012 @ 10:57

    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 Dye posted this reply January 16, 2012 @ 11:17

    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 Kelleher posted this reply January 16, 2012 @ 11:27

    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 login or Sign up To post replies