Copied to clipboard

Flag this post as spam?

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


  • Simon Dingley 1474 posts 3431 karma points c-trib
    Jul 13, 2011 @ 07:52
    Simon Dingley
    0

    useDomainPrefixes Does Not Honour The HTTPS Protocol

    I have a multi-site install and each site is configured seperately in IIS as each requires it's own SSL Certificate but they are all pointing at a single installation of Umbraco. I've enabled useDomainPrefixes in umbracoSettings.config however it forces all pages to the HTTP protocol so I've had to turn it off again. 

    Going to investigate if this is an issue in the source but thought I would post this up for any feedback in the meantime.

    See my other thread if you are interested in part one of the issues I've encountered on this multi-site project > Published changes only visible after bumping web.config

  • Simon Dingley 1474 posts 3431 karma points c-trib
    Jul 13, 2011 @ 10:46
    Simon Dingley
    1

    Found the problem in the niceUrlJuno method where the urls are hard coded with a http prefix

    See the source here http://umbraco.codeplex.com/SourceControl/changeset/view/6f33e2b81175#umbraco%2fpresentation%2flibrary.cs

    The question is now whether it would be safe to amend to:

    if (UmbracoSettings.UseDomainPrefixes)
    {
        var protocol = HttpContext.Current.Request.Url.Scheme;
    
        Domain[] domains =
            Domain.GetDomainsById(nodeId);
        // when there's a domain on a url we'll just return the domain rather than the parent path
        if (domains.Length > 0)
        {
            if (currentDomain != String.Empty)
            {
                foreach (Domain d in domains)
                {
                    // if there's multiple domains we'll prefer to use the same domain as the current request
                    if (currentDomain == d.Name.ToLower())
                        parentUrl = String.Concat(protocol, "://", d.Name);
                }
            }
    
            if (parentUrl == String.Empty)
            {
                parentUrl = String.Concat(protocol, "://", domains[0].Name);
            }
    
            return parentUrl;
        }
    }
  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 13, 2011 @ 12:29
    Jan Skovgaard
    0

    Hi Simon

    I don't know if it's safe to amend the code but have you also created a work item for this on codeplex? If so please post it so people can vote it up - this is an annoying bug :-)

    /Jan

  • Simon Dingley 1474 posts 3431 karma points c-trib
    Jul 13, 2011 @ 12:47
    Simon Dingley
    0

    Added here http://umbraco.codeplex.com/workitem/30359 - please vote it up and hopefully this will be addressed soon. This is a bit of a show stopper for me as of now so will have to amend the source and see if my changes work.

  • Bijesh Tank 192 posts 420 karma points
    Jul 13, 2011 @ 13:17
    Bijesh Tank
    0

    Would this package help? I was thinking of giving it a go and see it works. http://our.umbraco.org/projects/website-utilities/force-ssl

  • Simon Dingley 1474 posts 3431 karma points c-trib
    Jul 13, 2011 @ 13:19
    Simon Dingley
    0

    Possibly but would have to redirect every request which I'd imagine is not terribly efficient.

Please Sign in or register to post replies

Write your reply to:

Draft