Building a GeoIP Redirection facility on a multi-lingual site. Need to redirect to appropriate language site (not necessarily the language for the country!). Am getting tied up in knots with the URL creation and redirection. Is there an equivalent of library.GetCurrentDomains for V7?
Also what's the best way to actually do the redirection? This is all in controllers before any page is called so Umbraco.Web.Mvc.UmbracoTemplatePage etc isn't there.
Maybe "domains" aren't what I should be looking for. I'm trying to list out the /en-us/ part of the address, basically all the home page names, looking to see if we're already in that language's site and if not redirecting to the new language site. It's a combination of GeoIP Redirection, and country switching page. What I'm doing at the moment is causing things like /en-US/un-US/somepage, just getting tied up in knots basically. There must be a solution for this somewhere. Pity that IP Redirection package doesn't exist anymore.
Is there a library.GetCurrentDomains for V7?
V7.2.2
Building a GeoIP Redirection facility on a multi-lingual site. Need to redirect to appropriate language site (not necessarily the language for the country!). Am getting tied up in knots with the URL creation and redirection. Is there an equivalent of library.GetCurrentDomains for V7?
Also what's the best way to actually do the redirection? This is all in controllers before any page is called so Umbraco.Web.Mvc.UmbracoTemplatePage etc isn't there.
Any advice would be appreciated.
Craig
Hi Craig
Does some of the suggestions in this post work/help? https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/53750-Get-root-node-id-from-domain-name-%28requesturl%29
/Jan
Thanks Jan,
Tried that but got a list length of 0.
Maybe "domains" aren't what I should be looking for. I'm trying to list out the /en-us/ part of the address, basically all the home page names, looking to see if we're already in that language's site and if not redirecting to the new language site. It's a combination of GeoIP Redirection, and country switching page. What I'm doing at the moment is causing things like /en-US/un-US/somepage, just getting tied up in knots basically. There must be a solution for this somewhere. Pity that IP Redirection package doesn't exist anymore.
Hi Craig
Ok, how is your site structure? And is there one or more hostname setup?
/Jan
is working on a reply...