PHPackages                             symkit/redirect-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. symkit/redirect-bundle

ActiveSymfony-bundle[HTTP &amp; Networking](/categories/http)

symkit/redirect-bundle
======================

This bundle allows you to manage internal and external redirects directly from your database

v0.0.1(4mo ago)00MITPHPPHP &gt;=8.2CI failing

Since Feb 22Pushed 4mo agoCompare

[ Source](https://github.com/SymKit/redirect-bundle)[ Packagist](https://packagist.org/packages/symkit/redirect-bundle)[ RSS](/packages/symkit-redirect-bundle/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (17)Versions (2)Used By (0)

Symkit Redirect Bundle
======================

[](#symkit-redirect-bundle)

[![CI](https://github.com/symkit/redirect-bundle/actions/workflows/ci.yml/badge.svg)](https://github.com/symkit/redirect-bundle/actions)[![Latest Version](https://camo.githubusercontent.com/18eac88e48b16ff1eb83d02bac191a96fe5295e7fb44e86bd642f069c498753e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73796d6b69742f72656469726563742d62756e646c652e737667)](https://packagist.org/packages/symkit/redirect-bundle)[![PHPStan Level 9](https://camo.githubusercontent.com/1bc07920f0d36e55c17e1d38b1caa132cc605f51a82b388c962870b9a747b898/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230392d627269676874677265656e2e737667)](https://phpstan.org/)

Symfony bundle to manage URL redirects (internal and external) from the database, with validation, route integration, and global search.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Symfony 7.0 or 8.0
- Doctrine ORM
- For the admin UI: `symkit/crud-bundle`, `symkit/metadata-bundle`, `symkit/menu-bundle`
- To link redirects to routes: `symkit/routing-bundle`
- For global search: `symkit/search-bundle`

Installation
------------

[](#installation)

```
composer require symkit/redirect-bundle
```

Register the bundle in `config/bundles.php` (automatic with Flex):

```
return [
    Symkit\RedirectBundle\RedirectBundle::class => ['all' => true],
];
```

Configuration
-------------

[](#configuration)

All options are enabled by default. Example with explicit values:

```
# config/packages/symkit_redirect.yaml
symkit_redirect:
    enabled: true
    doctrine:
        entity_class: Symkit\RedirectBundle\Entity\Redirect
        repository_class: Symkit\RedirectBundle\Repository\RedirectRepository
    admin:
        enabled: true
        route_prefix: admin_redirect
        path_prefix: /admin/redirects
    listener:
        enabled: true
    search:
        enabled: true
```

- **enabled**: Enable or disable the whole bundle.
- **doctrine.entity\_class**: FQCN of the redirect entity (see "Custom entity").
- **doctrine.repository\_class**: FQCN of the redirect repository.
- **admin.enabled**: Register the CRUD controller and admin routes.
- **admin.route\_prefix**: Prefix for route names (e.g. `admin_redirect_list`, `admin_redirect_edit`).
- **admin.path\_prefix**: URL path prefix (e.g. `/admin/redirects`).
- **listener.enabled**: Register the listener that performs redirects on each request.
- **search.enabled**: Register the redirect search provider for global search.

Routes
------

[](#routes)

Include the admin routes in your application (e.g. `config/routes.yaml`):

```
symkit_redirect:
    resource: '@SymkitRedirectBundle/config/routes.yaml'
    prefix: '%symkit_redirect.admin.path_prefix%'
```

This registers: `admin_redirect_list`, `admin_redirect_create`, `admin_redirect_edit`, `admin_redirect_delete`.

Usage
-----

[](#usage)

### Manual creation

[](#manual-creation)

```
use Symkit\RedirectBundle\Entity\Redirect;

$redirect = new Redirect();
$redirect->setUrlFrom('/old-page');
$redirect->setUrlTo('/new-page');

$entityManager->persist($redirect);
$entityManager->flush();
```

### Admin interface

[](#admin-interface)

With `admin.enabled: true` and `symkit/crud-bundle`, `symkit/metadata-bundle`, and `symkit/menu-bundle` installed, the CRUD interface is available at the configured URL (default `/admin/redirects`).

### Redirects to an internal route

[](#redirects-to-an-internal-route)

If `symkit/routing-bundle` is installed, you can choose an internal route as the destination instead of an external URL ("Internal Route" field in the form).

Custom entity
-------------

[](#custom-entity)

To use your own entity (extra fields, behaviour, etc.):

1. Extend `Symkit\RedirectBundle\Entity\Redirect` or implement `Symkit\RedirectBundle\Contract\RedirectEntityInterface` with the same Doctrine mapping.
2. Configure the FQCN:

```
symkit_redirect:
    doctrine:
        entity_class: App\Entity\MyRedirect
```

3. Map your entity in Doctrine (XML or attributes) as usual.

Validation
----------

[](#validation)

The bundle validates in particular:

- Relative URLs starting with `/`.
- No redirect from an URL to itself.
- Unique source (one redirect per source URL).
- A destination must be set (URL or internal route).

Validation messages live in the `validators` domain (bundle files `validators.*.xlf`).

Global search
-------------

[](#global-search)

With `search.enabled: true` and `symkit/search-bundle`, redirects are indexed in global search (by source or destination URL). The displayed category is translated (domain `SymkitRedirectBundle`).

Translations
------------

[](#translations)

- Domain: **SymkitRedirectBundle**.
- XLIFF files in `translations/`: `SymkitRedirectBundle.en.xlf`, `SymkitRedirectBundle.fr.xlf`.
- Constraint messages: `validators.en.xlf`, `validators.fr.xlf` (domain `validators`).

Form labels, admin list, and search use this domain.

Tests
-----

[](#tests)

The bundle is covered by **unit** tests (services, form, validation), **integration** tests (bundle boot with TestKernel, Doctrine repository), and **functional** tests (HTTP request → 308 redirect). Run the suite with `make test`. Full quality (style, static analysis, architecture, mutation) runs via `make quality`; the mutation score (Infection) target is at least 64% on covered code.

Contributing
------------

[](#contributing)

```
make install
make cs-fix
make phpstan
make test
make quality         # cs-check + phpstan + deptrac + lint + test + infection
make ci              # security-check + quality
```

License
-------

[](#license)

MIT.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance76

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

132d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/077eba6702dc23a795ee2262dff92505e3c8ead08f7cb205be80d8aae0a6b8e5?d=identicon)[sdieunidou](/maintainers/sdieunidou)

---

Top Contributors

[![sdieunidou](https://avatars.githubusercontent.com/u/570763?v=4)](https://github.com/sdieunidou "sdieunidou (11 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/symkit-redirect-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/symkit-redirect-bundle/health.svg)](https://phpackages.com/packages/symkit-redirect-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M387](/packages/easycorp-easyadmin-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)[api-platform/doctrine-orm

Doctrine ORM bridge

294.4M92](/packages/api-platform-doctrine-orm)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
