Page URL path priority

Mark Cabana asked on September 30, 2019 02:11

Hello Guys,

I created 2 pages with the first page (let us call it page-1) having:

Page URL Path: Use custom URL path (yes), Path type (Standard URL or wildcard ), Path or pattern (/books)

Aliases: Route: /books/{PathParam1}

And a second page (let us call it page-2) having:

Page URL Path: Use custom URL path (yes), Path type (Standard URL or wildcard ), Path or pattern (/books/fiction)

Aliases: /books/fiction

According to Kentico 11 documentation here under URL processing:

"The request in this example specifies a standard URL path, so the request is handled by the Kentico URL rewriting engine. The most prioritized way to identify standard pages is the Page URL path, so the engine first attempts to find a page with a URL path set to /products/kentico-cms.

If there is no page with a matching URL path, the rewriting engine tries to look up a page with an Alias path equal to /products/kentico-cms (the alias path is generated according to the page's position in the content tree)."

So if I understand correctly, page-2 will be the priority match over page-1 if we browse http://www.mysite.com/books/fiction. BUT that is not what's happening on our end. Kentico is always prioritizing page-1 aliases over page-2 page url path.

Recent Answers


Juraj Ondrus answered on September 30, 2019 09:25

What is the version and hotfix of Kentico you are using? I tried it on Kentico 11 and 12 with latest hotfixes and it is working fine.
Also, how did you managed to add the page alias for page 2 which is the same as the Path or pattern?
I noticed that your page alias for page 1 is set to be Route - what is the reason to use route instead of the standard path? Do you have any ASP.NET Route pattern set? If not, please use the standard path option. But still, I was unable to reproduce the issue. Have you tried clearing the browser cache from the beginning of time?
Also, are you using extension-less URLs? If not, then also specify the .aspx extension for the page alias for page 1.

0 votesVote for this answer Mark as a Correct answer

Mark Cabana answered on October 1, 2019 06:37

Thank you for the reply Juraj. We are current at 11.0.40.

"Also, how did you managed to add the page alias for page 2 which is the same as the Path or pattern?" - I was referring to the page aliases, not the page alias, where you can set it to whatever you want using the Add New Alias button.

"I noticed that your page alias for page 1 is set to be Route - what is the reason to use route instead of the standard path? Do you have any ASP.NET Route pattern set? " - Yes, we are using the route pattern to access the params on our web parts.

"Also, are you using extension-less URLs" - Yes we are.

0 votesVote for this answer Mark as a Correct answer

Mark Cabana answered on October 1, 2019 07:00 (last edited on October 1, 2019 07:03)

Image Text Image Text

This is a sample setup. If i go to /fiction, it does land on the correct page. But if I go to /fiction/subfiction I will still land on the fiction page.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on October 1, 2019 14:05

Thank you for the details. From your first message I got the impression the pages are on the same level, not sub pages. I was able to reproduce the issue on a clean Kentico instance as well as on v11.0.40. But it works fine when using the latest hotfix. It looks like that there was, regrettably, a bug. Is it possible for you to apply the latest hotfix on your Kentico project? I am sorry for this trouble.

0 votesVote for this answer Mark as a Correct answer

Mark Cabana answered on October 2, 2019 00:50

Thank you Jurja, appreciate the assistance on this issue. We just decided to change the page alias of page-1 from a route to standard/wildcard.

0 votesVote for this answer Mark as a Correct answer

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