Copied to clipboard

Flag this post as spam?

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


  • Andreas Pfanner 196 posts 314 karma points
    Dec 28, 2010 @ 13:28
    Andreas Pfanner
    0

    Multilingual with sub directories - set default root page

    Hello,

    I've tried to build up a new site with multiple languages without use of subdomains. So I want my language versions to be accessible through:

    www.mysite.com - default version (german)

    www.mysite.com/de (german)

    www.mysite.com/en (english)


    So I created a homepage "de" and a homepage "en" for both versions (and hostnames with /de and /en), as well as a parent site holding both of them. My structure now is:

    Content

    -- MySite

    ---- de

    ------ Produkte

    ---- en

    ------ Products


    Because of I used a empty page "MySite" for organizational purposes (if there are additional sites in future), I have the problem that if I go to the root domain without directory, I get an empty page (= the MySite page). How can I point to the de Homepage by default without doing a manual redirect?

    I've tried to add the hostname www.mysite.com to the de page, but then the culture/language is ALWAYS set to german (so It overrides language for en pages). How to solve that?

    Kind Regards,
    Andreas

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Dec 28, 2010 @ 13:34
    Dirk De Grave
    0

    Add an umbracoInternalRedirectId property of type contentPicker to your MySite page document type and have it set to the /de page, so it will redirect to that page upon entering the www.mysite.com

    (http://our.umbraco.org/wiki/reference/umbraco-best-practices/umbracointernalredirectid)

    Add hostnames (may be dummy ones, as long as the culture is ok) to the /en and /de pages.

    Cheers,

    /Dirk

  • Andreas Pfanner 196 posts 314 karma points
    Dec 28, 2010 @ 13:40
    Andreas Pfanner
    0

    Dirk, thanks for the incredible fast and helpful reply! That's what I was looking for..

  • Andreas Pfanner 196 posts 314 karma points
    Dec 28, 2010 @ 14:03
    Andreas Pfanner
    0

    One more question according to this topic:

    I have 2 search pages:

    - /de/suche.aspx

    - /en/search.aspx


    I have a form in the Master Page template which should post to the specific search page. Is it right to store the search page path as Dictionary entry to set the form action dynamically?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Dec 28, 2010 @ 14:45
    Dirk De Grave
    0

    Ok, 3rd try before I break this forum again....

    you could use dictionary items, but wouldn't recommend that in case someone changes the name of the page.. which would make the url turn into a 404...

    Add an extra property on the 'en' and 'de' page (content picker) and use it to retrieve the page from xslt or from within your template (depending on how you're building up the form)

     

    Cheers,

    /Dirk

  • Andreas Pfanner 196 posts 314 karma points
    Dec 28, 2010 @ 15:02
    Andreas Pfanner
    0

    Alright, but then I get back the page ID instead of the right (absolute) url.

      <form id="searchform" method="post" action=''>
        <input value="Search" id="search" />
      form>

    If the form is shown on

    www.mysite.com/en/solutions/dms.aspx

    The form action will go to
    www.mysite.com/en/solutions/1234.aspx (not working) instead of
    www.mysite.com/en/search.aspx

    How to get that (current language sub directory & nice page name) using a page field in a template? Do I need a XSLT macro to convert the page template to the right URL format? (1234 -> /en/search.aspx)

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Dec 28, 2010 @ 15:18
    Dirk De Grave
    0

    Yup, a content picker only has the id of the node, there's a couple of ways to get it from your template:

    action="<%=umbraco.library.NiceUrl(int.Parse(umbraco.presentation.nodeFactory.Node.GetCurrent().GetProperty("searchPage").Value.ToString())%>"

    or using the inline xslt syntax as outlined here

    <umbraco:Item runat="server" field="searchPage" xslt="umbraco.library:NiceUrl({0})" />

    Hope this helps.

    Regards,

    /Dirk

  • Andreas Pfanner 196 posts 314 karma points
    Dec 28, 2010 @ 15:31
    Andreas Pfanner
    0

    Pretty cool, thank you!

  • Andreas Pfanner 196 posts 314 karma points
    Feb 03, 2011 @ 13:35
    Andreas Pfanner
    0

    Hello,

    using umbracoInternalRedirectId for my root page mapping to the default language homepage (e.g. /de), this page is then accessible via the following TWO urls:

    http://www.mysite.com/
    http://www.mysite.com/de

    So since its a transparent redirect (using umbracoInternalRedirectId), also search engines doesn't recognize this, which may be a disadvantage concerning SEO?!

    What do you think? Would it be better to get REALLY and visibily redirected to /de (the default language) to avoid that there are 2 URLs which provide exactly the same contents? How do others handle that on their multilingual sites? 


    Best Regards

    Andreas

Please Sign in or register to post replies

Write your reply to:

Draft