MASSIVE ART_Luca Rath-Heel_640x640
Luca Rath-Heel
Core Developer – Sulu GmbH
Would love to code even while skiing

SuluRedirectBundle 2.0 Released

We are pleased to announce that yet another official Sulu bundle has been released — the SuluRedirectBundle 🎉

Packed with some great features like importing redirects and, of course, full compatibility with Sulu 2 and Symfony 5.

What is the SuluRedirectBundle?

As a developer, you probably recognize this situation: you need to add some redirects you got from a content manager via email to an nginx redirects file, create a pull request, wait until that has been merged, and then redeploy the whole website just for a few new redirects to be applied. That’s a long process, especially if the content manager could simply do that by themselves. And that’s the challenge the SuluRedirectBundle solves.

This bundle adds simple but powerful capabilities for managing redirects to Sulu’s administration interface and allows content managers to manage redirects without any knowledge of web servers.

Just bear in mind that a redirect is only taken into account if no page or article with the same URL exists, because redirects have the lowest priority in the system.

Importing redirects

One of the great features of this bundle is the ability to import redirects from a CSV file. The most simplified file just contains two columns, “source” and “target”. Of course, all the other options like “statusCode”, “sourceHost”, and “enabled” can also be set in the import file.

It’s also possible to override existing redirects with an import; you just have to set the same value for “source”.

Enabling and disabling redirects

Sometimes it’s necessary to prepare redirects which are not ready yet, especially if you have a large number of redirects. Of course there’s a solution for that — toggler in the toolbar to enable or disable redirects quickly. This allows you to import a large number of disabled redirects and then check them in the administration interface, before enabling them when needed.

Different statuses

The SuluRedirectBundle comes with three different statuses to be used for redirects:

  • 301 Moved permanently
  • 302 Moved temporarily
  • 410 Gone

Each of them is useful in different situations, but I think they are quite self explanatory.

Credits

We are very happy to say that we members of our community contributed some of these features . A big thanks to @kleinkoerkamp and @Emilvooo for making the bundle compatible with Sulu 2, and to @choonge for adding a feature to allow the "sourceHost" option to be configured.

Your feedback is important

If you encounter any problems when installing or upgrading the SuluRedirectBundle or you just want to share some ideas, feel free to contact us.

And the best way to show us you like this bundle is to give a ⭐ on Github!