Copied to clipboard

Flag this post as spam?

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


  • Fuji Kusaka 2203 posts 4220 karma points
    Nov 02, 2011 @ 11:18
    Fuji Kusaka
    0

    Permanent Redirection in Umbraco

    Can someone explains how to make a permanent redirection in umbraco when working with Multilingual Website?

     

  • Rodion Novoselov 694 posts 859 karma points
    Nov 02, 2011 @ 12:36
    Rodion Novoselov
    0

    Hi. I suspect that http://our.umbraco.org/projects/developer-tools/301-moved-permanently is more or less what you want.

  • Fuji Kusaka 2203 posts 4220 karma points
    Nov 03, 2011 @ 07:30
    Fuji Kusaka
    0

    Hi Rodion, this seems to be a good solution. Have you try it before? What Type do you use in your documentType when using it  "TextString" ?

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Nov 03, 2011 @ 07:45
    Fuji Kusaka
    0

    Am not sure this is working. What I need to do is a permanent Redirection. 

    That is when i type something like this in my browser

    http://www.website.com it redirects me to http://www.website.com/en or http://www.website.com/en/

  • Mikkel Ovesen 1 post 21 karma points
    Nov 03, 2011 @ 10:45
    Mikkel Ovesen
    0

    In one of my older projects I made a usercontrol and added it to the default website. This usercontrol checked the language settings of the browser or using one of the free IP databases, with these details it made a redirect using C# code to the localised website.

    I am unsure whether there exists a better way of doing it, but it worked for me. I would not make a permanent redirect though.

            private string GetUrl()
            {
                var ip = Request.UserHostAddress;
                var remoteCountry = LookupService.getCountry(ip);
                var remoteCountryCode = (remoteCountry ?? new Country("--", "--")).getCode();
    
                var country = CountryRepository.GetByCode(remoteCountryCode);
                if (country == null)
                {
                    return DefaultWebsiteUrl();
                }
    
                var websiteCultureCode = ContractService.GetValidContract(country.WebsiteCulture);
                var node = _websiteCultureService.GetWebsite(websiteCultureCode);
    
                var url = library.NiceUrl(node.Id);
    
                Trace.Write("Redirecting - IP: " + ip + " is from " + remoteCountryCode + ", redirecting to: " + url);
    
                return url;
            }
    
    
  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Nov 03, 2011 @ 10:46
    Jeroen Breuer
    1

    Perhaps this blogpost can help: http://cultiv.nl/blog/2010/12/19/tip-of-the-week-the-ultimate-site-structure-setup/. The comments are also useful.

    Jeroen

  • Fuji Kusaka 2203 posts 4220 karma points
    Nov 03, 2011 @ 12:09
    Fuji Kusaka
    0

    Hey Jeroen Thanks for the the blogpost. Got it working by using this in my UrlRewriting.config

    <add name="En"
      virtualUrl= "^~/$"
    rewriteUrlParameter="ExcludeFromClientQueryString"
    destinationUrl="~/en/"
    ignoreCase="true"
    redirect="Application"
    redirectMode="Permanent" />

    //fuji

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies