Copied to clipboard

Flag this post as spam?

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


  • Horst Sterr 171 posts 133 karma points
    Aug 12, 2009 @ 20:30
    Horst Sterr
    0

    Problem with useDomainPrefixes - no unique URL starting with 3rd level

    Hi,

    i set up a umbraco installation with 2 roots, assigned "hostnames" to the roots and set "useDomainPrefixes" to true.
    Everything works fine till the 2nd node level. Beginning with the 3rd level the URLS are no more unique

    Structure looks like this:

    DE             www.domain.de
        Node1            www.domain.de/Node1.aspx
            Node1.1      /Node1/Node1.1.aspx
        Node2            www.domain.de/Node2.aspx
    
    EN              www.domain.com
        Node1            www.domain.com/Node1.aspx
            Node1.1      /Node1/Node1.1.aspx
        Node2            www.domain.com/Node2.aspx

    Any ideas if this is a bug or I'm doing something wrong
    I had a similar scenario on a umbraco3 website where this was working perfect at any node level

    Thank you for any help
    /Horst

     

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Aug 12, 2009 @ 21:36
    Morten Bock
    0

    I just took a look at my personal site, and it seems to be working fine as far as I can tell. 

    Where are you looking at the urls? From the admin section?

    When visiting the pages in the frontend, do you get the right page for the right domain, or do you always get the page for the first domain?

    Are you using the NiceUrl method to link between the two domains?

  • Horst Sterr 171 posts 133 karma points
    Aug 13, 2009 @ 00:40
    Horst Sterr
    0

    Hi Morten,
    yes, looking in the admin section (properties tab)
    There are "Link to document" and "Alternative Links"
    Link to document is OK for level 1 and 2(http://www.domain.com/node1.aspx). At level 3 it starts without the domain (/node1/node1.1.aspx)
    Alternative links are OK at any level (starting with the domain)

    and yes, i' using the NiceURL method

    hm

  • Paul Blair 466 posts 731 karma points
    Aug 13, 2009 @ 01:26
    Paul Blair
    0

    I have a similar problem.

    Domain 1: xxx.com

    Domain 2: blog.xxx.com

    When I create a link in a blog article to a page below the 2nd layer in xxx.com/node1/somePage it generates the URL as blog.xxx.com/node1/somePage which of course doesn't exist. I assume it's a bug with niceURL & V4 but haven't had time to investigate yet.

    As a dirty hack i have just been putting in a redirection when my (understanding) user notices the problem:

        <add name="FixRedirectionBug1"
          virtualUrl="http://(.*)/fit-benefits/(.*)"
          rewriteUrlParameter="ExcludeFromClientQueryString"
          destinationUrl="https://xxxxx.com/fit-benefits/$2"
          ignoreCase="true"
          redirect="Domain"
          redirectMode="Permanent"/>

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Aug 13, 2009 @ 18:49
    Morten Bock
    0

    Ok, I can see what you mean. Except I don't acutally get the domain names on the 1st leve either. I am just about to try out some stuff, and will get back to you with a possible solution to this.

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Aug 13, 2009 @ 19:41
    Morten Bock
    1

    Alright. I figured out a workaround for this. Wuld probably be better to do a real xslt extension for this, but it gets the job done:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [
        <!ENTITY nbsp "&#x00A0;">
    ]>
    <xsl:stylesheet
        version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:msxml="urn:schemas-microsoft-com:xslt"
        xmlns:umbraco.library="urn:umbraco.library"
        xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon"
        xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes"
        xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath"
        xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions"
        xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings"
        xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
        xmlns:myStuff="urn:mystuff"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
        <xsl:output method="xml" omit-xml-declaration="yes" />
        <xsl:param name="currentPage"/>
        <msxml:script implements-prefix="myStuff" language="C#">
            <msxml:assembly name="umbraco"/>
            <msxml:assembly name="cms"/>
            <msxml:assembly name="businesslogic"/>
            <msxml:using namespace="umbraco.cms.businesslogic.web"/>
            <msxml:using namespace="umbraco"/>
            <![CDATA[
    
            public static XPathNodeIterator GetDomains(int nodeid) {
                Domain[] doms = library.GetCurrentDomains(nodeid);
                StringBuilder sb = new StringBuilder();
                sb.Append("<domains>");
                foreach (Domain dom in doms)
                {
                    sb.Append(string.Format("<domain id=\"{0}\" name=\"{1}\" language=\"{2}\" />", dom.Id, dom.Name, dom.Language.CultureAlias)); 
                }
                sb.Append("</domains>");
                XmlDocument xd = new XmlDocument();
                xd.LoadXml(sb.ToString());
                XPathNavigator xp = xd.CreateNavigator();
                return xp.Select("/domains");
            }
    
            ]]>
        </msxml:script>
    
        <xsl:template match="/">
            <!--Do all your regular stuff here-->
            <xsl:value-of select="concat('http://', myStuff:GetDomains(2015)/domain[1]/@name, umbraco.library:NiceUrl(2015))"/>
        </xsl:template>
    </xsl:stylesheet>

     

    So this means that you need to do a bit of extra work around you links in the macros. However, the probably does not do anything for links created in the RTE by users.

     

  • Horst Sterr 171 posts 133 karma points
    Aug 13, 2009 @ 21:04
    Horst Sterr
    0

    :-) OK thank you Morten.
    Actually i go seaside for a couple of days tomorrow :-D
    Will try when am back.

    Thank you

    /Horst

  • Connie DeCinko 931 posts 1160 karma points
    Mar 28, 2011 @ 17:34
    Connie DeCinko
    0

    As stated, this does nothing for user created links and does not address the real issue, which appears to be a bug in the core of Umbraco.  Where is the resolution?

     

  • Marcelo 5 posts 25 karma points
    Apr 06, 2011 @ 17:15
    Marcelo
    0

    Hello, I came across this issue with no way to solve it.  Did someone got the chanse to solve it.  I started with a clen project on Umbraco 4.7 and applied the useDomainPrefixes and next, all the "Lint to document" url do not work.

     

  • Connie DeCinko 931 posts 1160 karma points
    Apr 06, 2011 @ 17:25
    Connie DeCinko
    0

    Upgrading to Umbraco 4.7 is what resolved it for us.

     

  • Marcelo 5 posts 25 karma points
    Apr 06, 2011 @ 20:16
    Marcelo
    0

    I got it, had to update umbracoUseDirectoryUrls to true and umbracoHideTopLevelNodeFromPath to false.  Great!!

  • Peter Nielsen 159 posts 257 karma points
    Dec 12, 2011 @ 11:42
    Peter Nielsen
    0

    Im sitting with the exact same problem... I have tried everything, and with the newest version of Umbraco but nothing works. I have made a xslt extension, but that doesnt do the trick when the users make links in the TinyMCE Editor. So the xslt extension solution only does half the job :/


    Anybody know how I can get these domains to stick... or how I can force the system to use the alternative links?! :-)

    Thanks

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Dec 12, 2011 @ 17:59
    Morten Bock
    0

    This is a major hack solution, but you could use this method to override the normal {locallink:xxxx} parser: http://our.umbraco.org/forum/developers/extending-umbraco/4589-Overriding-umbraco-locallink-parser

    That would also catch the content links created inside the rich text editor.

    Again, it IS a hack, so be aware that you might break stuff when upgrading, since you are essentially replacing core functionality.

  • Tizer 170 posts 201 karma points
    Mar 09, 2012 @ 05:03
    Tizer
    0

    I have this problem also using multiple sites and hostnames, in the 3rd level the "Link to document" is incorrect as described above, but the "Alternative Links" is correct.

    We can't upgrade to 4.7 as we are on SQL Server 2005 and Umbraco 4.0.3.

    What are my options here?

    Some of the nodes are named the same as the first site and the structure is the same, so the url is the same... I'm concerned that something is going to break along the line.


  • Tizer 170 posts 201 karma points
    Mar 12, 2012 @ 00:51
    Tizer
    0

    With the fix which Morten Bock posted on page 1.... what do I do with that?  Where do I put it etc, or do I have to included this in every xslt file?

     
  • Tizer 170 posts 201 karma points
    Mar 12, 2012 @ 13:02
    Tizer
    0

    I can't get this solution to work, I have used the code from Morten Bock in an xslt file, but it is not clear how to use it on our template to change the "link to document" link.... what do I have to do to make it resolve this issue, I'm confused?

     

  • Tizer 170 posts 201 karma points
    Mar 13, 2012 @ 00:39
    Tizer
    0

    OK - I'm getting concerned now.... I'm halfway through a project and this is hindering progress.... should I stop and make a new install of umbraco, or should I carry on as there is a fix for 3rd level navigation?

  • Tizer 170 posts 201 karma points
    Mar 27, 2012 @ 08:11
    Tizer
    0

    I know - I sound like a broken record... but still trying to fix this.

    If I make <add key="umbracoHideTopLevelNodeFromPath" value="true" /> Link to Document doesn't work

    If I make <add key="umbracoHideTopLevelNodeFromPath" value="false" /> Link to Document does work - but the top level node with the first domain doesn't.

    I am still not sure if this problem is a bug in umbraco, or a misconfiguration by me.

     

Please Sign in or register to post replies

Write your reply to:

Draft