Hi, I am trying to figure out best way to handle cultures / hostnames I do not have configured in the BackEnd.
I have a single root node that is configured with 3 cultures (en, nz, au). When I try browsing the site for lets say /de that I do not have setup in the CMS, I'd like to direct users to a "default" /en site, rather than a 404 that I currently get.
Also, I am struggling a bit with is trying to test this accordingly. My locality is NZ, when I call .GetCulture() on a page, I get NZ, no matter if I am on / or /en or /nz or /au site (which does make sense).
By default, when I type in my dev URL, I get to / homepage, with website navigation (and links in general) pointing to /nz/... and culture debug message on page saying en-NZ.
When I manually go to /au links are updated (culture doesn't change).
Any ideas how best to handle cultures I don't "expect" to provide content for?
I employ Geo coding across the site and decided to use the combination of the GEO vs my "allowed" cultures with preferred location detection. I use an override for OnApplicationStarting setting a custom RenderMvcController
Handling of unset culture / hostname setting
Hi, I am trying to figure out best way to handle cultures / hostnames I do not have configured in the BackEnd.
I have a single root node that is configured with 3 cultures (en, nz, au). When I try browsing the site for lets say /de that I do not have setup in the CMS, I'd like to direct users to a "default" /en site, rather than a 404 that I currently get.
Also, I am struggling a bit with is trying to test this accordingly. My locality is NZ, when I call .GetCulture() on a page, I get NZ, no matter if I am on / or /en or /nz or /au site (which does make sense).
By default, when I type in my dev URL, I get to / homepage, with website navigation (and links in general) pointing to /nz/... and culture debug message on page saying en-NZ. When I manually go to /au links are updated (culture doesn't change).
Any ideas how best to handle cultures I don't "expect" to provide content for?
I employ Geo coding across the site and decided to use the combination of the GEO vs my "allowed" cultures with preferred location detection. I use an override for OnApplicationStarting setting a custom RenderMvcController
DefaultRenderMvcControllerResolver.Current.SetDefaultControllerType(typeof(LanguageRedirectRenderMvcController));
Side note: be aware that Model.Content.GetCulture() will give you different result to Model.CurrentCulture
is working on a reply...