Is it possible to use parameters in URL instead of query params with content tree-based routing?

Charles Levesque asked on July 12, 2023 21:07

Hi all!

I was wondering if it was possible to tell Xperience 13 with content tree-based routing that the last part of the URL is a parameter to send to the controller. For example, I have a mental health resources directory on a website that is at /en/resources. In this directory, you can search by region. Doing so, it will add the region code in the URL. For resources in Montreal, the URL would be /en/resources/montreal.

The reason for this is simple: we are putting each URL to regions in the site map so that search engines can display the URL to users that are searching for mental health resources in their region. For now, I was only able to pass the region filter as a query parameter to the URL. For the /en/resources/montreal link, Xperience 13 returns a 404 since it thinks it is a different route and I don't have any page types or custom routing that handles this URL.

I thought that maybe if I code a custom route just for this situation that redirects the user to the resources page with the region filter in query, it will solve my problem. If you have suggestions with an included Xperience 13 feature, It would much appreciated =).

Thank you for your time!

Charles =)

Recent Answers


Ömer Karagülmez answered on July 21, 2023 10:05

Hello Charles,

You could review this document. Setting up content tree based routing

If it won't be beneficial we can discuss in detail.

0 votesVote for this answer Mark as a Correct answer

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