Link redirection: Equivalent of site_properties > redirect_links in Plone 5

There was a time when anonymous links would act as redirects. To enable the behaviour it was a matter of changing the value of portal_properties > site_properties > redirect_links in the ZMI.

I'm not seeing how to achieve similar behaviour in Plone 5.

For now I'm using a TTW Python script (just save it as whatever you want as your "redirect_name" and in the script change "redirect_here" appropriately).

## Script (Python) "redirect_name"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=Redirects to a location listed here
##
container.REQUEST.RESPONSE.redirect(context.portal_url()+'/redirect_here')

this is based on these notes:
http://www.uwosh.edu/ploneprojects/docs/how-tos/creating-a-redirect-to-a-url-or-default-view

The code is still there, but now you have to look at the registry:

Hmm... so this needs to be brought forward somewhere in the interface.

please open a new issue and mark it as regression; this should be fixed in both, Plone 5.0 and Plone 5.1.

@hvelarde thanks for the feedback, the code you posted was enough of a clue to send me looking at the Content Settings.

It turns out that there is a way to enable link redirection already.

Under Site Setup > Content Settings
Select the (1) Link content type then check the box that says (2) Redirect immediately to link target

1 Like