PHPackages                             miranj/craft-redirector - 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. miranj/craft-redirector

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

miranj/craft-redirector
=======================

A Craft CMS plugin for redirecting URLs to entries.

3394PHP

Since Dec 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/miranj/craft-redirector)[ Packagist](https://packagist.org/packages/miranj/craft-redirector)[ RSS](/packages/miranj-craft-redirector/feed)WikiDiscussions dev Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Redirector
==========

[](#redirector)

A [Craft CMS](https://craftcms.com/) plugin for handling legacy paths and URLs by preventing 404s and redirecting to the new entry's URL.

Contents
--------

[](#contents)

- [Usage](#usage)
- [Installation](#installation)
- [Requirements](#requirements)
- [Changelog](./CHANGELOG.md)
- [License](./LICENSE)

Usage
-----

[](#usage)

In order to handle legacy paths and URLs, we need to create a field to capture them. We can make use of [Craft's built-in URL field](https://craftcms.com/docs/4.x/url-fields.html) for this purpose.

1. Create a new field of type URL. Set the *Allowed URL Types* to *Web Page*.
2. Add this field to all sections where entries have URLs of their own.
3. Create a config file for this plugin `config/redirector.php` and add the handle of the field created in the first step.

    ```
