Copied to clipboard

Flag this post as spam?

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


  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jul 11, 2012 @ 12:33
    Tim
    0

    uComponents MultiSite 404 behaving differently on Live to Dev

    Hiya,

    I have been using the uComponents multisite 404 on a multilingual site. On the dev site it works fine. On the live site however, we're getting the standard Umbraco 404 page instead.

    Dev site is server 2008, IIS 7.5. The main difference is that the live site is running 2003/IIS 6.5. It's currently running on a port, but I tried setting the dev site to the same port and it worked fine. I've looked through the config files, and the code for the handler on codeplex, but I can't see anything that wuld obviously spazz out on IIS6.5.

    Anyone come across this and have any ideas what this could be?

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jul 11, 2012 @ 13:01
    Lee Kelleher
    0

    Hi Tim,

    The MultiSitePageNotFoundHandler tries to match a hostname with a node, then checks the "umbracoPageNotFound" property for a redirect nodeId (the 404 page).

    The hostname match uses Request.ServerVariables["SERVER_NAME"] ... so thinking this might somehow be an issue?

    Can't see anything else in the source-code that might be causing a problem.  If you do find a bug, let me know - we'll patch it up pronto.

    Cheers, Lee.

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jul 11, 2012 @ 13:39
    Tim
    0

    Hiya,

    Think I've tracked down the issue. Umbraco doesn't let you specify ports for host names, so if you're running on anything other than port 80, and you've got the site set to append the hostnames to the links, you have to include the port in the domain setting, e.g. www.mysite.com:82, otherwise the links don't work. When the handler checks for the domain, it doesn't include the port, so it doesn't find the root for the domain.

    To get round it you could check for a non-standard port and append it on the end of the domain and check for that as well, but to be honest this is probably a pretty rare edge case!

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jul 11, 2012 @ 15:32
    Tim
    1

    If you do want to add support for this, it's dead easy, just change the line that has:

    var domain = HttpContext.Current.Request.ServerVariables["SERVER_NAME"];

    to:

     

    var domain = HttpContext.Current.Request.ServerVariables["SERVER_NAME"];

    //if there is a port number, append it
    var port = HttpContext.Current.Request.ServerVariables["SERVER_PORT"];

    if (!string.IsNullOrEmpty(port) && port != "80")
    {
    domain += ":" + port;
    }

     

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jul 11, 2012 @ 15:40
    Lee Kelleher
    0

    Thanks Tim.

    Would you mind creating a ticket on our CodePlex please? http://ucomponents.codeplex.com/WorkItem/Create

    So that I don't lose track of it.

    Cheers, Lee.

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jul 11, 2012 @ 15:51
    Tim
    0

    Will do!

    :)

Please Sign in or register to post replies

Write your reply to:

Draft