Redirect module form elements

Hi all,

I was wondering what the redirect module form elements field type is for in Drupal 7 (screenshot) and if there is a similar thing in Drupal 8?

Hi

Yes it exists in Drupal 8 too if you enable the module. In Node edit mode it allows you to create custom redirections and manage existing ones for the specific node.

Thank you!
How do I decide when to put an URL redirect?
Is it something that needs to be at all the nodes? Or just when I want to access the node by different ways?

Usually you create redirects when you change the URL of a page.

When you create a node in Drupal usually it uses the node’s name to create the URL unless you have set it otherwise in URL Patterns.

For example let’s say that you create a node with title Hello World. Once you save it the URL is https://mywebsite.web.cern.ch/hello-world

If you decide later to change the node’s name to Hello and you save it then the URL will become https://mywebsite.web.cern.ch/hello and hence create a broken link for the old one.

If you enable URL redirects on your website along with Path auto, prevents this from happening.

In the moment that you will change the node’s title and the URL will change, it will also create automatically a redirection from the old URL to the new so there is no broken link.

1 Like