Copied to clipboard

Flag this post as spam?

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


  • Benjamin Ravn 35 posts 68 karma points
    Jul 16, 2014 @ 10:40
    Benjamin Ravn
    0

    Multi-language site - how to remove main language from path?

    Hello everybody

    I'm working on a multi-language site, and I want to leave out the primary language from the path, but I can't figure out how to do this.

    The site structure looks like this: Umbraco multi-language site structure

    I have on the language (Dansk and English) added the property umbracoUrlName, so I can use "da" and "en" insted of the name. It works perfectly fine, but I would actually like to set "da" to "", so the primary language is hidden from the path.

    Of course if I set it for "", it will use the name insted, so I'm looking for another way to solve it, without needing to change the site structure.

    I sure hope you can help me! :)

    /Benjamin

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Jul 16, 2014 @ 10:52
    Alex Skrypnyk
    0

    Hi Benjamin,

    Did you map domains in hostnames management?

    http://screencast.com/t/E5LGPQ7CeNb

    Thanks, Alex

  • Benjamin Ravn 35 posts 68 karma points
    Jul 16, 2014 @ 11:09
    Benjamin Ravn
    0

    Hi Alex

    The languages are mapped, but should that effect the path?

    Thanks!

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Jul 16, 2014 @ 11:14
    Alex Skrypnyk
    100

    Yes, mapping path is way how Umbraco decide what home page to use. Try to set domain without 'da' to Danish home node.

    Thanks, Alex

  • Benjamin Ravn 35 posts 68 karma points
    Jul 16, 2014 @ 11:34
    Benjamin Ravn
    2

    Perfect! Thanks, it works!

    And since it was already indexed by Google, I just added the following to UrlRewriting.config:

    <add name="daRedirect"
        redirect="Application"
        redirectMode="Permanent"
        ignoreCase="true"
        virtualUrl="^/da/(.*)"
        destinationUrl="~/$1" />
    

    I hope this will help other with same question.

    Have a nice summer! :)

Please Sign in or register to post replies

Write your reply to:

Draft