Download the PHP package zenstruck/redirect-bundle without Composer
On this page you can find all versions of the php package zenstruck/redirect-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zenstruck/redirect-bundle
More information about zenstruck/redirect-bundle
Files in zenstruck/redirect-bundle
Package redirect-bundle
Short Description Store redirects for your site and keeps statistics on redirects and 404 errors
License MIT
Homepage https://github.com/kbond/ZenstruckRedirectBundle
Informations about the package redirect-bundle
ZenstruckRedirectBundle
This bundle adds entities for redirects and 404 errors.
For redirects, 404 errors are intercepted and the requested path is looked up. If a match is found it redirects to the found redirect's destination. The count and last accessed date are updated as well. A redirect form type and validation is available as well.
404 errors can be logged as well. Each 404 error is it's own record in the database. The path, full URL, timestamp, and referer are stored. Storing each error as a separate record allows viewing statistics over time and seeing all the referer URLs. When a redirect is created or updated, 404 records that match it's path are deleted.
Installation
-
Install with composer:
- Enable the bundle: This Step is only needed if you are not using Symfony Flex.
Configuration
NOTE: A NotFound
or Redirect
or both must be configured.
Redirect
-
Create your redirect class inheriting the MappedSuperClass this bundle provides:
-
Set this class in your
zenstruck_redirect.yml
: - Update your schema (or use a migration):
NotFound
-
Create your not found class inheriting the MappedSuperClass this bundle provides:
-
Set this class in your
zenstruck_redirect.yml
: - Update your schema (or use a migration):
Form Type
This bundle provides a form type (zenstruck_redirect
) for creating/editing redirects.
You may want to disable the source
field for already created redirects:
Full Default Configuration
All versions of redirect-bundle with dependencies
doctrine/doctrine-bundle Version ^2.6
doctrine/orm Version ^2.6|^3.0
symfony/framework-bundle Version ^5.4|^6.0|^7.0