How do I force the system to use the site page alias?

Kurt Muller asked on August 24, 2018 12:56

Hi guys,

I've setup a multilingual page, consisting of an English page and Spanish page, where both cultures share the same alias path. Their respective full URLs are: en.sitename.com/about-us-url es.sitename.com/about-us-url

When I am linking the page anywhere (in a repeater, link in editable text), it's always using the default Page alias where I would like it to use the new alias I created. I cannot set it as a path pr pattern because it needs to be unique,and both cultures share this same name.

Any help would be great as to how I can force the newly created aliases.

Screenshots below:

Image Text

Image Text

Recent Answers


Arun Kumar answered on August 24, 2018 14:30

You can change URL in linking dialog to your page alias.

~/about-us to ~/about-us-url
0 votesVote for this answer Mark as a Correct answer

Lorenz Lammersdorf answered on August 24, 2018 14:59

Set the page alias to "about-us-url" for your ddefault language and leave the Page URL Path and Alias empty for all languages. By default Kentico uses the NodeAliasPath, which is defined by the Page Alias.

0 votesVote for this answer Mark as a Correct answer

Kurt Muller answered on August 27, 2018 08:55

Thanks guys,

@Arun, your answer makes sense, but I do not want to manually update it. If I have an end user with no dev or cms knowledge, I don't expect them to make these kind of changes.

@Lorenz, this would work if my full page path matches my tree structure, but in some cases the URL does not match it's relative path.

Basically, a combination of both of your answers would be great :)

0 votesVote for this answer Mark as a Correct answer

Lorenz Lammersdorf answered on August 28, 2018 10:14

Hi Kurt,

I ran into a similar problems, for some pages the position in the tree doesn't match the expected URL. Unfortunately it seems that Kentico doesn't provide a suitable method to set a "virtual" URL as default. We had very few (2 or 3) of these pages, so we decided to set up rewrite rules for these pages in IIS. Of course this is not very sophisticated.

0 votesVote for this answer Mark as a Correct answer

Kurt Muller answered on September 5, 2018 19:01

Thanks for the answers so far. Hoping there is someone that can shed some light on a solution.

:)

0 votesVote for this answer Mark as a Correct answer

David Forster answered on September 11, 2018 13:13

You could try hooking into the Global Events, specifically DocumentEvents : https://docs.kentico.com/k11/custom-development/handling-global-events

This would allow you to update the page alias programmatically whenever a CMS editor saves the page. i.e. you could use it to enforce your custom business rules

0 votesVote for this answer Mark as a Correct answer

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