Copied to clipboard

Flag this post as spam?

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

  • Patrik Wibron 40 posts 67 karma points
    Nov 06, 2009 @ 11:02
    Patrik Wibron

    www in URL being removed while clicking links

    Hi folks!
    Having some problems on a site with multi-domains. If the visitor is accessing and clicks on a menuitem/link on the page, he will be redirected to ; instead of the www in the beginning of the URL.

    I've been adding the domains in the "manage domains" on the languagenode correctly and I also made a republish of the whole Content-node. 

    Any ideas how to make this work on the site?


  • Immo Wache 69 posts 224 karma points
    Nov 07, 2009 @ 09:43
    Immo Wache

    Hi Patrik,

    unfortunately this don't work because "manage domains" isn't meant to be this way. This only works if you have different root level domains for your web server (e.g. and both pointing to the same IP address and web server and you have your server set up for both domain names correctly). BTW This my error on start with umbraco too, the whole theme is a little bit confusing. If you use path extentions for language selection you must remove your "manage domains" settings and manage the language distinction manually or by writing XSLT macros which take care about that. This is the way I do it with my little web site . It is still not perfect bilingual (AutoForm macro is only in german) but neverless I'm quite proud on it ;-)

    Search the forum, there are plenty of tips for this problem, also in the old books section. 

    HTH, Immo

  • fed 199 posts 70 karma points
    Nov 09, 2009 @ 11:51

    Just to clarify a bit. When using "Manage domains" on a multilingual site, you also get to set the culture for the specific node. This way when you are fetching dictionaryitems formatting dates etc you get the correct word/format.

    If you move away from them you need to handle the cultures manually via a usercontrol or something, am I right?

    Post your solution here when you solve it Patrik.

  • Immo Wache 69 posts 224 karma points
    Nov 10, 2009 @ 03:00
    Immo Wache

    Hi Patrik, yes that's the point: Dictionary items only work "out of the box" when you go the "Manage domains" way.

    Ok I try to explain my solution with subfolders and macro logic. My Site structure is:

     +- ucc-bln
         +- en  <- doctype: Blog Home/Frontpage
         |   |
         |   +- ...
         +- de  <- doctype: Blog Home/Frontpage
             +- ...

    Then I use a Python macro with (which could be rewritten in C# too with no problems I assume)

    The macro alias is SetUiLanguage

    # using Xml 
    from System.Xml import *
    from System.Xml.XPath import *
    from System.Threading import *
    from System.Globalization import *
    # The fun starts here -->
    # create the xpath iterator by current node
    iterator = umbraco.library.GetXmlNodeCurrent()
    # get the culture info name form root node data 'cultureInfoName'
    iterator = iterator.Current.Select("ancestor-or-self::node[@level=2]/data[@alias='cultureInfoName']")
    culture = iterator.Current.Value
    # set the culture info
    Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(culture);
    Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;

    The Blog Frontpage master template uses this macro like this:

    <%@ Master Language="C#" MasterPageFile="/umbraco/masterpages/default.master" AutoEventWireup="true" %>
    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <html xmlns="">
    <head profile="">
             <!-- Set Ui Culture Info -->
             <umbraco:Macro Alias="SetUiLanguage" runat="server" />

    The Blog Frontpage DocumentType must have a Tab "Language" with two Textstring properties: language and cultureInfoName

    for german Blog Frontpage document it is set to: language deutsch; cultureInfoName de-DE
    for english Blog Frontpage document it is set to: language english ; cultureInfoName en-US

    With this logic you can use the dictionary items.

    HTH, Immo

Please Sign in or register to post replies

Write your reply to: