sulu / redirect-bundle
Sulu bundle for managing redirects
Installs: 171 028
Dependents: 1
Suggesters: 0
Security: 0
Stars: 18
Watchers: 12
Forks: 19
Open Issues: 5
Type:sulu-bundle
Requires
- php: ^7.2 || ^8.0
- doctrine/orm: ^2.5.3
- friendsofsymfony/rest-bundle: ^2.8 || ^3.0
- handcraftedinthealps/rest-routing-bundle: ^1.0
- jms/serializer-bundle: ^3.0 || ^4.0 || ^5.0
- ramsey/uuid: ^3.1 || ^4.0
- sulu/sulu: ^2.2.5 || ^2.3@dev
- symfony-cmf/routing: ^2.1 || ^3.0
- symfony/config: ^4.3 || ^5.0 || ^6.0 || ^7.0
- symfony/console: ^4.3 || ^5.0 || ^6.0 || ^7.0
- symfony/dependency-injection: ^4.3 || ^5.0 || ^6.0 || ^7.0
- symfony/event-dispatcher: ^4.3 || ^5.0 || ^6.0 || ^7.0
- symfony/http-foundation: ^4.3 || ^5.0 || ^6.0 || ^7.0
- symfony/http-kernel: ^4.3 || ^5.0 || ^6.0 || ^7.0
- symfony/property-access: ^4.3 || ^5.0 || ^6.0 || ^7.0
- symfony/routing: ^4.3 || ^5.0 || ^6.0 || ^7.0
Requires (Dev)
- doctrine/data-fixtures: ^1.1
- handcraftedinthealps/zendsearch: ^2.0
- jackalope/jackalope-doctrine-dbal: ^1.3.4 || ^2.0
- jangregor/phpstan-prophecy: ^1.0
- php-cs-fixer/shim: ^3.0
- phpspec/prophecy: ^1.10
- phpspec/prophecy-phpunit: ^1.0 || ^2.0
- phpstan/phpstan: ^1.0
- phpstan/phpstan-doctrine: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpstan/phpstan-symfony: ^1.0
- phpunit/phpunit: ^8.5.39 || ^9.6.20 || ^10.0
- symfony/browser-kit: ^4.3 || ^5.0 || ^6.0 || ^7.0
- symfony/dotenv: ^4.3 || ^5.0 || ^6.0 || ^7.0
- symfony/framework-bundle: ^4.3 || ^5.0 || ^6.0 || ^7.0
- symfony/monolog-bundle: ^3.1
README
The SuluRedirectBundle 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.
The SuluRedirectBundle is compatible with Sulu starting from version 2.0. Have a look at the require
section in
the composer.json to find an
up-to-date list of the requirements of the bundle.
🚀 Installation and Documentation
Execute the following composer commands to add the bundle to the dependencies of your project:
composer require sulu/redirect-bundle
Afterwards, visit the bundle documentation to find out how to set up and configure the SuluRedirectBundle to your specific needs.
💡 Features
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
Those status codes are explained in detail here.
Automatic Gone
redirects
This bundle also adds the possibility to automatically create redirects with status 410 Gone
, if a page or a entity with a route has been removed. This is very useful, because now search engines know, that this page has been deleted.
Route Priorities
Redirects created via this bundle will only be used if no other route matches the given URL. This ensures that accidentally created or imported redirects do not affect existing pages. If a redirect matches the URL of an existing page, the redirect will only be effective after the page was unpublished.
In combination with the SuluAutomationBundle, this behaviour makes it possible to precautionarily create a redirect for the URL of an existing page that will be unpublished at a specified time in the future by the SuluAutomationBundle.
❤️ Support and Contributions
The Sulu content management system is a community-driven open source project backed by various partner companies. We are committed to a fully transparent development process and highly appreciate any contributions.
In case you have questions, we are happy to welcome you in our official Slack channel. If you found a bug or miss a specific feature, feel free to file a new issue with a respective title and description on the the sulu/SuluRedirectBundle repository.
📘 License
The Sulu content management system is released under the terms of the MIT License.