Kentico 13 Redirects or lack of

Aaron Hoy asked on April 26, 2023 22:58

We are in the process of upgrading to Kentico 13 and have noticed they you can no longer have redirects on a page. This used to appear on the navigation tab of a page. This poses a problem for our current implementation in that we have some pages listed in a section so that they can be part of our left navigation, but there is no content on them it just redirects to the page. This seems like pretty basic functionality that I am surprised was removed. Am I missing something? I have included a screenshot to show that the 5 pages are redirects to hopefully help explain what I am talking about. Thanks for any input you might be able to provide! Image Text

Correct Answer

Brenden Kehren answered on April 26, 2023 23:40

There are several options for this:

  • Create a page type to handle those redirects. We do this to handle places we simply need a placeholder page in navigation or in the content tree. The page type has these simple fields:

LinkDisplayName
LinkURL
LinkTarget

In your controller check to see if Url.IsLocalUrl(link.LinkURL). If so, return LocalRedirect(link.LinkURL); else return RedirectPermanent(link.LinkURL);

  • Another option is to utilize the new functionality in the latest refresh. You can unpublish a page and set the Redirect on unpublish: field to a given url in the system.
1 votesVote for this answer Unmark Correct answer

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