Copied to clipboard

Flag this post as spam?

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


  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Mar 30, 2011 @ 14:44
    Jeroen Breuer
    0

    Url rewrite for multi-language websites

    Hello,

    I've got a website in 2 languages, but both languages have their own url. For exameple I have:

    - test.nl
    - test.co.uk

    The problem is that if I go to test.nl/co-uk I can also visit the other language, because that's simply a node in the website. The same goes for test.co.uk/nl. Can I do some url rewritting that if I'm on test.nl and I try to go to test.nl/co-uk it get's redirected to test.nl again and the same if I'm on test.co.uk of course. Any idea what's the best solution?

    Jeroen

  • David Verberckmoes 46 posts 77 karma points
    Mar 30, 2011 @ 15:00
    David Verberckmoes
    0

    Jeroen,

    set umbracoHideTopLevelNodeFromPath in the web.config to true.

    Then put the hostnames in umbraco BO on the test.nl and test.co.uk nodes (with their correct language which you should have defined)

    Rgds,

    David#

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Mar 30, 2011 @ 15:02
    Jeroen Breuer
    0

    Hi David,

    I've already done that. The problem is my languages aren't the top nodes. There is a node above it with some site settings. So my structure is:

    -Website
    --language1
    --language2

    On language1 and language2 I've set the host names, but I can still go to the other language.

    Jeroen

  • Yannick Smits 321 posts 718 karma points
    Mar 30, 2011 @ 16:53
    Yannick Smits
    0

    You need to set useDomainPrefixes to true in the /config/umbracoSettings.config.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Mar 30, 2011 @ 17:05
    Jeroen Breuer
    0

    What does useDomainPrefixes do?

    Jeroen

  • David Verberckmoes 46 posts 77 karma points
    Apr 01, 2011 @ 13:14
    David Verberckmoes
    0

    Jeroen,

    You can use the rewriting like this, add these lines to the UrlRewriting.config in the config folder

     

                     rewriteUrlParameter="ExcludeFromClientQueryString" 
    destinationUrl="http://www.test.nl/$1"
    redirect="Domain"
    redirectMode="Permanent"
    ignoreCase="true" />

    and the opposite rewriting for the other domain

     

                      rewriteUrlParameter="ExcludeFromClientQueryString" 
    destinationUrl="http://www.test.co.uk/$1"
    redirect="Domain"
    redirectMode="Permanent"
    ignoreCase="true" />

    I hope this is the solution for your setup.

    Rgds,

     

    David#

     

  • Yannick Smits 321 posts 718 karma points
    Apr 01, 2011 @ 13:26
    Yannick Smits
    0

    this will ensure that urls are unique when running with multiple root nodes

Please Sign in or register to post replies

Write your reply to:

Draft