Massimo Franciosa
Massimo Franciosa

Reputation: 554

Kentico 8 - Localization with url prefixes - default document

I'm trying to follow the documentation page below to Use language prefixes for URLs

https://docs.kentico.com/display/K8/Configuring+URLs+for+multilingual+websites

I got a page with the alias "Home" that should be the default document for all the cultures.

three cultures are currently available:

what i want to achieve is the following:

all of those should display the page with "Home" alias in the desired culture.

what I currently got instead is:

basically, is ignoring the url-prefix.

MY SETUP

1) got a page under the root with alias "Home" (which should be default) localized with all 3 cultures

2) in Settings/Content in the section "Web site content", "Default alias path" is set to "/Home".

3) in Settings/Urls & Seo in the section "SEO - Cultures" the values are the following:

Am I doing something wrong? do I need to setup the website differently in order to let this work as expected?

Thanks

ADDITONAL INFORMATION ABOUT THE BEHAVIOUR

additional test cases about the weird behaviour of the site:

both of these seems ok, BUT both are displaying (french France) culture

the problem is that it should use just the url alias "home", just like the normal fr-fr version. this alias is specified under the Url tab of the page: url setup on page

CURRENT SETTING

Following you can find the page that I want to be default. Bear in mind that “Use custom URL path” was set to false, but for test purposed I turned that on, trying to associate /Home for all the cultures. Problem is that as soon as I save the path becomes “/Home-1”. I think this is because the default version of Home has already the Path “/Home”.

Page I want as homepage

SETTINGS UNDER CONTENT Bear in mind here that I tried to use a macro to choose “Default alias path” in a different way depending on the culture. It didn’t work as it didn’t process the macro at all (the site was redirected to the literal string of the macro)

content settings

SETTINGS UNDER URL & SEO Here I tried to check the “Use name path for URL path” option, but still no luck. (tried [baseurl]/nl-be and still shows the fr-fr version of the Homepage) settings url & seo 1 settings url & seo 2

Upvotes: 1

Views: 1153

Answers (4)

Massimo Franciosa
Massimo Franciosa

Reputation: 554

ANSWER FROM KENTICO SUPPORT

steps that I took to solve the problem:

1) under Url and Seo/Default page : select "Use domain root"

2) for each culture of the homepage > "Page URL Path", check "Use custom url path" and set "Path or pattern" to empty string ("")

now everything works as expected.

[domainname]/ > correctly redirects to [domainname]/fr-fr showing fr-fr culture

[domainname]/fr-fr > correctly shows fr-fr culture homepage

[domainname]/fr-BE > correctly shows fr-BE culture homepage

[domainname]/nl-BE > correctly shows nl-BE culture homepage

Upvotes: 0

Anton Grekhovodov
Anton Grekhovodov

Reputation: 287

I had the same problem, but I needed domain.com as main url for en-gb culture and for other domain.com/fr-fr and etc. And I couldn't find out of box solution, so I developed a custom module which catches events when TreeNode element is updated or created, and I update DocumentUrlPath column of current node with value "/" +culture code (or alias if it exists) + "/" + Current Document Name. And I check if the currect document is home page, I save it without document name. Also I untick from checkbox "Use prefixes for URLs" in settings.

Now everything works perfect on my site.

Upvotes: 1

Boris P.
Boris P.

Reputation: 415

I'd suggest to go thru this article cultures demystified (for version 7, but the settings are still there) It's possible you are forcing a visitor culture on the site (Sites application)/user (Users application) settings, also enable the kentico SQL debug and check which culture is retrieved (in general which SQL queries are executed) based on the where condition...this could be an indication of what's going on...try also logging in as a different user and try different browsers (browsers have preferred language settings based on which kentico decides the displayed culture)

Make also sure you haven't setup aliases / page paths on the home page for specific cultures.

Upvotes: 1

Dawid Jachnik
Dawid Jachnik

Reputation: 447

You need to setup also in settings Urls and SEO > SEO - URLs > Default page as Use domain root

Upvotes: 0

Related Questions