Having more than one culture alias setup in the url

Dominic Carvalho asked on January 17, 2019 10:52

Hey, I am currently trying to setup an alias for a sub culture of french and the url structure needs to be.

domain.com/fr/ch

However the page is 404'ing as Kentico recognizes the culture as /fr/ and then the page name as /ch/ and therefor is 404'ng. We need the fr/ch to be a culture route on its own.

Is their a way around this issue?

Regards, Dominic

Recent Answers


Ron Truex answered on January 17, 2019 15:40

Could you add the ch at the end of the url so /fr/pagename/ch That could easily be setup at the page level.
You could look at probably setting up a global event to parse the url.

could you instead try /fr-ch/pagename https://docs.kentico.com/k9/multilingual-websites/setting-up-multilingual-websites/configuring-urls-for-multilingual-websites https://docs.kentico.com/k9/multilingual-websites/setting-up-multilingual-websites/configuring-urls-for-multilingual-websites

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on January 17, 2019 18:13

You will have to use Properties > URLs > Path or Pattern to do this two level URL, and not the enforce culture prefix.

So in the Path or Pattern for each page in each culture, you will enter something like

  • /fr/ch/pagename
  • /fr/fr/pagename

You can do this manually with more control or create an EventHandler to auto populate that field based on culture and page alias.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on January 18, 2019 10:45

Hi,
USing the fr-ch format as suggested by Ron is the easiest way. Otherwise, you are using the path format - so Kentico is looking for pages path structure like

-fr
--ch
----page

So, one option is to use the alias type ROUTE and let .Net routing to handle this. This way the URLs are not handled by Kentico. You need to keep it in mind.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.