Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm currently working on developing public CMS web sites with SharePoint 2010. The site will use two languages on it that will be two separate site collections on the same web application. Two managed paths will be used for this.

The question is what will happen when hitting http://www.somecompany.com/.

There are two options here:

  1. Redirect (permanent?) to the default language, which would be "en"
  2. Check the browser language and redirect to "fr" if matching, or else to default language "en"

How would I set up the redirects? Would there be differences between the two options? Do I have to set up a site collection on http://www.somecompany.com/ as well and redirect or is there another way of doing this since that site collection would be used for anything else?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

If you dont want to set up a site collection at http://www.somecompany.com, You can achieve the redirection using httpmodule. The httpmodule is applied at web application level so it doesn't care if your site collection really exists.

In the httpmodule, You can check for Accept-Language header using the Headers collection in the Request object : Request.Headers["Accept-Language"]

Or

You can use the code like here : http://madskristensen.net/post/Get-language-and-country-from-a-browser-in-ASPNET.aspx

share|improve this answer

Your best bet is to use the built-in SharePoint Server variations functionality. It will take care of all the redirection etc. For more info, start here http://technet.microsoft.com/en-us/library/cc262055.aspx

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.