PHPackages                             camelot/canonical-url-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. camelot/canonical-url-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

camelot/canonical-url-bundle
============================

Canonical URL Symfony bundle

v3.0.1(4y ago)31522MITPHPPHP ^8.0

Since Oct 7Pushed 3y ago1 watchersCompare

[ Source](https://github.com/CamelotProject/canonical-url-bundle)[ Packagist](https://packagist.org/packages/camelot/canonical-url-bundle)[ RSS](/packages/camelot-canonical-url-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (14)Versions (10)Used By (0)

Canonical Url Bundle
====================

[](#canonical-url-bundle)

The `CanonicalUrlBundle` is a Symfony bundle to redirect requests from multiple URLs for the same resource to a single canonical URL.

For example, if you had a resource named `/about-us` for your site `example.org`it could potentially be accessed with:

```
http://example.org/about-us
http://example.org/about-us/
http://www.example.org/about-us
http://www.example.org/about-us/
https://example.org/about-us
https://example.org/about-us/
https://www.example.org/about-us
https://www.example.org/about-us/

```

When a user requests the resource with any of the above URLs, `CanonicalUrlBundle` will build a canonical URL based on a predefined site URL and will perform an HTTP redirect to it if the request URL does not match.

The bundle can also add a `` tag to your Twig templates, see the [Usage](#usage) section for how.

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

[](#installation)

Applications that use Symfony Flex
----------------------------------

[](#applications-that-use-symfony-flex)

Open a command console, enter your project directory and execute:

```
$ composer require camelot/canonical-url-bundle
```

Applications that don't use Symfony Flex
----------------------------------------

[](#applications-that-dont-use-symfony-flex)

### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
$ composer require camelot/canonical-url-bundle
```

This command requires you to have Composer installed globally, as explained in the \[installation chapter\]\[composer\] of the Composer documentation.

### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `config/bundles.php` file of your project:

```
// config/bundles.php

return [
    // ...
    Camelot\CanonicalUrl\CamelotCanonicalUrl::class => ['all' => true],
];
```

### Step 3: Configure the Bundle

[](#step-3-configure-the-bundle)

Add your configuration for the bundle to `config/packages/camelot_canonical_url.yml`:

```
camelot_canonical_url:
    redirect:       true                  # Set to false disable redirects if you just want to use the canonical link tag
    redirect_code:  301                   # Leave this at 301 for SEO
    trailing_slash: false                 # Set to true if your routes and canonical URLs contain a trailing slash
```

Set the Symfony Router default URI in `config/packages/routing.yaml`

```
framework:
    router:
        # ...
        default_uri: 'https://example.org'
```

Usage
-----

[](#usage)

To add a `` tag to your pages include the following code in the `` of a twig template:

```
{{ camelot_canonical_link_tag() }}
```

The href attribute will default to the canonical URL for the current request, but this can be overridden:

```
{{ camelot_canonical_link_tag('https://example.org/my-custom-link') }}
```

License
-------

[](#license)

This bundle is released under the [MIT license](LICENSE)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 81% 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

Every ~115 days

Recently: every ~217 days

Total

9

Last Release

1483d ago

Major Versions

v1.0.0 → v2.0.02019-10-07

v1.0.1 → v2.0.12019-11-13

v1.0.2 → v2.0.22019-12-04

v2.0.2 → v3.0.02022-04-19

PHP version history (3 changes)v1.0.0PHP ^7.2

v2.0.0PHP ^7.4

v3.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0c37c32df3696c9b0e3f97375ae3ce40576267523ff0ca1d42f638beb251e706?d=identicon)[gwendolen](/maintainers/gwendolen)

---

Top Contributors

[![andyexeter](https://avatars.githubusercontent.com/u/6660584?v=4)](https://github.com/andyexeter "andyexeter (98 commits)")[![GwendolenLynch](https://avatars.githubusercontent.com/u/1427081?v=4)](https://github.com/GwendolenLynch "GwendolenLynch (22 commits)")[![thomas2411](https://avatars.githubusercontent.com/u/992685?v=4)](https://github.com/thomas2411 "thomas2411 (1 commits)")

---

Tags

canonical-urlsphpsymfony-bundle

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/camelot-canonical-url-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/camelot-canonical-url-bundle/health.svg)](https://phpackages.com/packages/camelot-canonical-url-bundle)
```

###  Alternatives

[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)

PHPackages © 2026

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