Copied to clipboard

Flag this post as spam?

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


  • Sebastian Dammark 583 posts 1407 karma points
    Dec 05, 2012 @ 14:01
    Sebastian Dammark
    0

    Simple multilingual site with 1 domain

    • Website
    • Danish (DA language)
    • Page 1
    • Page 2
    • Page 3
    • English (EN Language)
    • Page 1
    • Page 2
    • Page 3
    How should I do this, so that www.domain.dk and www.domain.dk/DA goes to the DA language and www.domain.dk/EN goes to the EN language.
    In short:
    • www.domain.dk, www.domain.dk/da -> DA Language
    • www.domain.dk/en -> EN Language

  • Morten 20 posts 61 karma points
    Dec 05, 2012 @ 16:04
    Morten
    0

    maybee some url rewrite rule to elemenat the DA and EN and hostnames on nodes for language?

  • Sebastian Dammark 583 posts 1407 karma points
    Dec 05, 2012 @ 16:09
    Sebastian Dammark
    0

    Current status:

    I've added umbracoInternalRedirectId to my rootnode and selected Danish as my redirect.
    Regarding hostnames I've added my www.domain.dk to the rootnode as well and it works splendid.

    But ... now dictionaries are fucked.  Apparently you're forced to add a domain (bogus.dk) when adding a language.
    And when I do that it all goes haywire.

    Without the bogus.dk my links look like this, but dictionaries doesn't work

     With the bogus.dk, my links are fucked, but dictionaries work
     

    What are my options here ...

  • Sebastian Dammark 583 posts 1407 karma points
    Dec 05, 2012 @ 16:09
    Sebastian Dammark
    0

    @Morten:  Yeah maybe.  But I have no clue about urlRewriting.

  • Morten 20 posts 61 karma points
    Dec 05, 2012 @ 16:49
    Morten
    0

    well i havent testet this at all but

    hostname for the danish  node should be /da/ and http://www.domain.dk/da/

    and the english  /EN/ and http://www.domain.dk/EN/

    that way your dictionaries should work

    then 2 urlrewrite rules they might look like 

    <add name="danishrewrite" 

    virtualUrl="^~/(.*).aspx" 

    rewriteUrlParameter="ExcludeFromClientQueryString" 

    destinationUrl="~/da/$1.aspx" 

    ignoreCase="true" />

     

    <add name="englishrewrite" 

    virtualUrl="^~/(.*).aspx" 

    rewriteUrlParameter="ExcludeFromClientQueryString" 

    destinationUrl="~/en/$1.aspx" 

    ignoreCase="true" />

     

     

    but i am no expert in this so maybee documentation for the urlrewriter can help you out 

    http://www.urlrewriting.net/

     

     edited: added .aspx for rules

  • Sebastian Dammark 583 posts 1407 karma points
    Dec 05, 2012 @ 17:22
    Sebastian Dammark
    0

    Well

    • www.domain.dk works
    • but /da/ and /en/ doesn't work

    I've tried with and without .aspx since I'm using DirectoryUrls.
    But with .aspx no redirect happend at all.

  • Sebastian Dammark 583 posts 1407 karma points
    Dec 06, 2012 @ 08:01
    Sebastian Dammark
    0

    Solution:

    I dropped the idea of using URLRewriting, since I couldn't figure it out :).

    Added 2 domains, www.domain.dk / domain.dk and en.domain.dk to each language layer.

  • Sebastian Dammark 583 posts 1407 karma points
    Dec 06, 2012 @ 08:02
    Sebastian Dammark
    0

    Morten get's the Karma points for helping out ...

  • Asif Malik 203 posts 339 karma points
    Dec 06, 2012 @ 16:26
    Asif Malik
    0

    Hi Sebastian, I know this is a bit late but looking at your site structure i think this would work

    Define the hostname on the Website node
    Rename the danish page to da or use the built in umbraco name override umbracoUrlName (http://our.umbraco.org/wiki/reference/umbraco-best-practices/umbracourlname)
    Rename the englsih page to en or use the built in umbraco name override umbracoUrlName (http://our.umbraco.org/wiki/reference/umbraco-best-practices/umbracourlname) 

     The above should mean that all links should work correctly ... well apart from the main site homepage, which you can set up a redirect to go to the da folder by addign the umbraco property umbracoRedirect or umbracoInternalRedirect ... or even via url rewriting.

    Hope it helps in case you need it in the future

Please Sign in or register to post replies

Write your reply to:

Draft