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.