I have a multilanguage website. In a custom widget I'm trying to get the home page url. There are two available languages: English and Spanish. The url of the home page is "http://mywebsite/home
" for the english language and http://mywebsite/es/home_es
for the Spanish.
Using the following code however gives me the wrong url:
PagesConfig pagesConfig = Config.Get<PagesConfig>();
PageManager pageManager =
PageNode page = pageManager.GetPageNode(pagesConfig.HomePageId);
homePageUrl = page.GetFullUrl(Thread.CurrentThread.CurrentUICulture,
For English language it returns http://mywebsite/home
which is correct, but for Spanish the url is wrong - http://mywebsite/es/home
which leads to 404 error. Is there another method for accessing the home page?