{"id":28400664,"url":"https://github.com/hafrit/permanentredirectionbundle","last_synced_at":"2026-05-07T05:31:24.742Z","repository":{"id":62513978,"uuid":"76803352","full_name":"hafrit/PermanentRedirectionBundle","owner":"hafrit","description":"This bundle enable you to create infinite number of redirection from config file.","archived":false,"fork":false,"pushed_at":"2017-04-10T13:38:22.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T18:40:27.867Z","etag":null,"topics":["301","302","hafrit","redirect-symfony","redirection","redirection-symfony","symfony-bundle","symfony-redirect","symfony-redirection"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hafrit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-18T19:52:24.000Z","updated_at":"2017-04-10T13:42:21.000Z","dependencies_parsed_at":"2022-11-02T13:30:59.365Z","dependency_job_id":null,"html_url":"https://github.com/hafrit/PermanentRedirectionBundle","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/hafrit/PermanentRedirectionBundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafrit%2FPermanentRedirectionBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafrit%2FPermanentRedirectionBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafrit%2FPermanentRedirectionBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafrit%2FPermanentRedirectionBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hafrit","download_url":"https://codeload.github.com/hafrit/PermanentRedirectionBundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafrit%2FPermanentRedirectionBundle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262421803,"owners_count":23308511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["301","302","hafrit","redirect-symfony","redirection","redirection-symfony","symfony-bundle","symfony-redirect","symfony-redirection"],"created_at":"2025-06-01T11:07:17.208Z","updated_at":"2026-05-07T05:31:24.714Z","avatar_url":"https://github.com/hafrit.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PermanentRedirectionBundle\n\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/5311cf99-0721-49de-887e-1b530451c650/mini.png)](https://insight.sensiolabs.com/projects/5311cf99-0721-49de-887e-1b530451c650)\n[![Total Downloads](https://poser.pugx.org/hafrit/permanent-redirection-bundle/downloads)](https://packagist.org/packages/hafrit/permanent-redirection-bundle)\n[![Latest Stable Version](https://poser.pugx.org/hafrit/permanent-redirection-bundle/v/stable)](https://packagist.org/packages/hafrit/permanent-redirection-bundle)\n[![License](https://poser.pugx.org/hafrit/permanent-redirection-bundle/license)](https://packagist.org/packages/hafrit/permanent-redirection-bundle)\n\nThis bundle enable you to create infinite number of redirection without using code.\n- User bookmark a page of your site that does't exist anymore so he will have a beautiful 404 page.\n- A link sent into an old mailing campaign and you want to redirect it instead of using controller redirection you can just configure your redirection.\n\n## Install\n\n### Step 1: Add to composer.json\n\n```\n\"require\" :  {\n    // ...\n    \"hafrit/permanent-redirection-bundle\": \"dev-master\",\n}\n```\n\n### Step 2: Enable the bundle\n\nEnable the bundle in the kernel:\n\n``` php\n\u003c?php\n// app/AppKernel.php\n\npublic function registerBundles()\n{\n    $bundles = array(\n        // ...\n        new hafrit\\PermanentRedirectionBundle\\hafritPermanentRedirectionBundle(),\n    );\n}\n```\n\n### Step 2: imports the bundle services.yml\n```yaml\n# app/config/config.yml\n\nimports:\n    // ...\n    - { resource: '@hafritPermanentRedirectionBundle/Resources/config/services.yml' }\n```\n\n## Usage: configure your permanent redirection\n\n```yaml\n# app/config/config.yml\n\nhafrit_permanent_redirection:\n    enable: boolean\n    redirection_lists:\n        - { source: \"source_route_name\", target: \"target_route_name\", status: \"redirection_status\", referenceType: integer, keepParameters: boolean }\n        .\n        .\n        .\n        - { source: \"source_route_name\", target: \"target_route_name\", status: \"301\" }\n        \n```\n## Parameters options:\n\n```yaml\nhafrit_permanent_redirection:\n    enable: true/false     ~ # Required\n    redirection_lists:\n        - { \n        source:         ~ # Required                # route name to redirect,\n        target:         ~ # Required                # target route name,\n        status:         ~ # Required                # redirection status (301, 302, ...) @see Symfony\\Component\\HttpFoundation\\Response.php isRedirect function         \n        referenceType:  ~ # Optional Default 1      # @see Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface.php,             \n        keepParameters: ~ # Optional Default false  # redirect to target route with the same source route parameters\n        }\n\n```\n\n## Example:\n\n```yaml\nhafrit_permanent_redirection:\n    enable: true\n    redirection_lists:\n        - { source: \"hello_world\", target: \"acme_hello_world\", status: \"301\" } \n        # \"hello_world\" =\u003e http://localhost/hello-world will be redirected to http://localhost/acme-hello-world with redirection code 301\n        - { source: \"hello_with_parameters\", target: \"acme_hello_with_parameters\", status: \"302\", keepParameters: true }\n        # \"hello_world\" =\u003e http://localhost/hello/firstName/lastName will be redirected with the same first and last name to http://localhost/acme-hello/firstName/lastName with redirection code 302\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhafrit%2Fpermanentredirectionbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhafrit%2Fpermanentredirectionbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhafrit%2Fpermanentredirectionbundle/lists"}