- Does this bundle work with Laravel or only Symfony?
- This package is designed for Symfony, not Laravel. If you're using Laravel, you’ll need to explore alternatives like Laravel’s built-in redirect middleware or third-party Laravel packages for similar functionality.
- How do I install this bundle in a Symfony project?
- Run `composer require agence-adeliom/easy-redirect-bundle`, update your `config/packages/easy_redirect.yaml` with your entity classes, and run migrations using `php bin/console doctrine:migration:diff` followed by `php bin/console doctrine:migration:migrate`.
- What Symfony and PHP versions does this bundle support?
- The latest version (3.x) supports Symfony 6.4/7.x and PHP 8.2+. Older versions (2.x) support Symfony 5.4/6.x and PHP 8.0.2+. Check the [README](https://github.com/agence-adeliom/easy-redirect-bundle) for exact compatibility.
- Can I use this bundle without EasyAdmin?
- No, this bundle is tightly coupled with EasyAdmin (v3.4+ or v4.0+). If you don’t use EasyAdmin, you’ll need to either adopt it or fork/modify the bundle to work with another admin panel, which may introduce maintenance challenges.
- How does the 404 logging feature work, and can I disable it?
- The bundle logs 404 errors to the database with details like path, URL, timestamp, and referrer. You can disable or configure this behavior via `config/packages/easy_redirect.yaml` by adjusting settings like `remove_not_founds` or skipping the listener.
- Will this bundle conflict with existing redirect systems (e.g., .htaccess or custom controllers)?
- Yes, conflicts are possible if your project already handles redirects or 404s via custom logic or tools like .htaccess. Audit your existing setup before integrating this bundle to avoid overlaps or unexpected behavior.
- How do I customize the redirect form or add extra fields?
- Extend the provided `RedirectFormType` in your project by creating a custom form type class and overriding the fields. The bundle’s `EasyRedirectTrait` in EasyAdmin also allows you to integrate the redirect management into your dashboard menu.
- Does this bundle support bulk operations for redirects or 404s?
- The bundle doesn’t natively support bulk operations out of the box. However, you can leverage Doctrine’s repository methods or EasyAdmin’s built-in CRUD features to implement custom bulk actions for redirects or 404 records.
- How can I optimize performance for high-traffic sites with 404 logging?
- For high-traffic sites, ensure the `path` column in the `redirect` table is indexed for faster lookups. Consider batching inserts for 404 logs or implementing async logging to reduce database load. Retention policies (e.g., purging old logs) can also help.
- What happens to logged 404s when I update or create a redirect?
- When you create or update a redirect, the bundle automatically deletes any logged 404 records that match the redirect’s path. This behavior is controlled by the `remove_not_founds` configuration and can be tested in staging to avoid data loss.