Try our conversational search powered by Generative AI!

Serve up page languages but displaying 1 URL only



We have an existing site with 3 domains:





Now, we want to redirect .au and .nz to .com but still keep track of their geographic location.

We want them to just use, and depending on their location, we will serve up the .au, .nz, or .com pages.

Having a language selector on the site is also an option.


We just want to promote and we've just upgraded to CMS 6.

Is it at all possible to do this? Any ideas on how to do it?



Sep 16, 2011 4:15

Just a follow up on this inquiry. In case someone knows how. Thanks.

Sep 21, 2011 0:40

Hi Jan!

I think that a globalized web site could work in your case. I would look into doing the actual selection of the "language" which in your case would be regions. Perhaps you can use Visitor Groups and try doing a regional match to see which "language" you should choose for the user. I think you can use ContentLanguage.SetCulture([the selected language]) here and this should be done early in the request life cycle to get before the built in language selection.

Sep 21, 2011 7:34

Hi Linus,

Thanks for the reply.

Does that mean that I'll drop the .nz, and .au (language) pages and just use visitor groups instead?

Sep 21, 2011 8:19

No, my idea was based on that the three different regions have similar site structures. You set up three langauge branches for your web site structure. But instead of having the user to select their region their selves you could use visitor groups to select the language for them when entering the site.

Sep 21, 2011 8:21

So a user from NZ enters, using visitors group API to detect origin, I then set Culture to en-NZ for example and would display contents supposedly for Did I get it right?

And although they're still seeing and browsing, contents displayed would be for NZ (

Edited, Sep 21, 2011 8:39

Yes, that's what I meant.

Sep 21, 2011 8:42

Thanks a lot Linus!

Sep 27, 2011 1:57

Was playing around with the suggestion but not able to make it work yet.

Aside from automatically loading the actual language page based on user location, we still need to have a language/location selection.

So I created a code with a dropdownlist for testing:

protected void Region_SelectedIndexChanged(object sender, EventArgs e)
CultureInfo culture = CultureInfo.CurrentCulture; //testing

switch (region.SelectedValue)
case ("NZ"):
ContentLanguage.PreferredCulture = new CultureInfo("en-NZ");
case ("AU"):
ContentLanguage.PreferredCulture = new CultureInfo("en-AU");
default: // ("US")
ContentLanguage.PreferredCulture = new CultureInfo("en-US");

 None of the culture setting works. The page reloads all right, but the content is still in US regardless of what language is selected.

Maybe I'm doing something wrong?

Sep 27, 2011 5:21

So this  will do the trick:


If I put that exact code on the OnLoad event, it would definitely display the NZ page.


But If I put that code on a dropdownlist event, it will not serve up the NZ page on postback for whatever reason.

I have no idea why.

Sep 27, 2011 7:08

By the way, from the CMS 6 Globalization Tech Note:

3. To implement a language selection option for the site visitors, see code in the Public Templates package.

Does anybody know where I can find this public templates package? This language selection option is exactly what I need.

Sep 27, 2011 8:13

The public template package was replaced with the Allow template package but this uses the URL:s to change language so that will probably not help you.

Sep 27, 2011 8:20
Thanks Linus.
Got a workaround to make it work. I'm sure there's a much elegant way to fix this but this sure works.
protected void Region_SelectedIndexChanged(object sender, EventArgs e)
Language = region.SelectedValue;
protected override void OnInit(EventArgs e)

string language = Language;
private string Language
if (Session["Language"] == null)
Session["Language"] = "en-US"; // set default
return Session["Language"] as string;
Session["Language"] = value;
Sep 27, 2011 9:17
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.