I already created multi domains or multilanguages site within umbraco without any problem. I m trying to figure out how to make a multi domain and languages site. As the master domain need to access the contents of the subsites I have to go in one single instance of umbraco, but I'm stuck with the hostnames. I tryed to play with the useDomainPrefixes settings, this enables umbraco to generated correct urls, but the pages becomes inaccessible, if not set, any url goes to the main site.
False alert... It works for the Master site the three languages and the first language of any other site... maes/fr e.g. doesn't work with a hostname maes.dev.be/fr
Oki, I found out there was no way, so I spent a lot if time to find out how to do something, while there is no way, and there is a bad documentation :-) So the way to go is to override the defaut umbraco page and change your culture on the initializeculture or preinit.
As in my case the code will be:
namespace VanRoey.Umbraco.Controls { public partial class _Default : umbraco.UmbracoDefault {
string[] p = this.Request.FilePath.Split(new char[] { '/' });
if (p.Length > 1) { switch (p[1].ToLower()) { case "en": case "en.aspx": System.Threading.Thread.CurrentThread.CurrentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); break; case "fr": case "fr.aspx": System.Threading.Thread.CurrentThread.CurrentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-BE"); break; case "nl": case "nl.aspx": System.Threading.Thread.CurrentThread.CurrentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("nl-NL"); break; } } }
Multi domain languages website
I already created multi domains or multilanguages site within umbraco without any problem. I m trying to figure out how to make a multi domain and languages site. As the master domain need to access the contents of the subsites I have to go in one single instance of umbraco, but I'm stuck with the hostnames. I tryed to play with the useDomainPrefixes settings, this enables umbraco to generated correct urls, but the pages becomes inaccessible, if not set, any url goes to the main site.
Any Idea how can I achieve this ?
Thanks
Laurent Lequenne
Ok ! I have to set the hostnames on the root with some language, and then the hostnames for each language part.. .e.g.
maes -> maes.dev.be
maes/nl -> maes.dev.be/nl : dutch
False alert... It works for the Master site the three languages and the first language of any other site... maes/fr e.g. doesn't work with a hostname maes.dev.be/fr
Bon !!! It's definitely OK, I forgot to set some template :-)
Becomes boring that thing ! Really Boring ! Now the culture of Umbraco is not more set !!! WTF!
Oki, I found out there was no way, so I spent a lot if time to find out how to do something, while there is no way, and there is a bad documentation :-) So the way to go is to override the defaut umbraco page and change your culture on the initializeculture or preinit.
As in my case the code will be:
namespace VanRoey.Umbraco.Controls
{
public partial class _Default : umbraco.UmbracoDefault
{
protected override void OnPreInit(EventArgs e)
{
base.OnPreInit(e);
SetCulture();
}
void SetCulture()
{
string[] p = this.Request.FilePath.Split(new char[] { '/' });
if (p.Length > 1)
{
switch (p[1].ToLower())
{
case "en":
case "en.aspx":
System.Threading.Thread.CurrentThread.CurrentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
break;
case "fr":
case "fr.aspx":
System.Threading.Thread.CurrentThread.CurrentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-BE");
break;
case "nl":
case "nl.aspx":
System.Threading.Thread.CurrentThread.CurrentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("nl-NL");
break;
}
}
}
}
}
is working on a reply...