PHPackages                             futureactivities/craft-custom-redirects - 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. [API Development](/categories/api)
4. /
5. futureactivities/craft-custom-redirects

ActiveCraft-plugin[API Development](/categories/api)

futureactivities/craft-custom-redirects
=======================================

Define custom redirects with API support

1.0.3(1y ago)082PHP

Since Feb 12Pushed 1y ago2 watchersCompare

[ Source](https://github.com/FutureActivities/Craft-Redirects)[ Packagist](https://packagist.org/packages/futureactivities/craft-custom-redirects)[ RSS](/packages/futureactivities-craft-custom-redirects/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

Craft Custom Redirects
======================

[](#craft-custom-redirects)

This provides a basic area of the CMS to define custom redirects. Requires **Craft v4+**

This plugin **does nothing on the frontend**, instead it only provides the following REST endpoint to lookup if a redirect exists:

```
/rest/v1/redirect

```

Which expects a body param of:

```
uri = the full path, e.g. /mortgages

```

regex is supported in the from field. Examples:

```
^/stansted?
^/(estate-agents/)?(\bedinburghwest\b)(/.*)?(/)?
^/estate-agents/(.*)/buying/?

```

Example Usage
-------------

[](#example-usage)

The plugin will respond in the following format:

```
{
    "from": "/one",
    "to": "/two",
    "code": "301"
}

```

You can then integrate this into your chosen frontend system however you require. For example, for Nuxt 3 this might be added to a catch all route like so:

```
const { data } = await useAsyncQuery(Url, { siteId: config.public.siteId, url: route.path.replace(/^\/+/g, '') });

// check if entry is null and trigger 404 error
if (!data.value || !data.value.entry) {
    // Check for a redirect
    const custom = await axios.post(config.public.cmsUrl + '/rest/v1/redirect', qs.stringify({ uri: route.path }));
    if (custom && custom.data)
        await navigateTo(custom.data.to, { redirectCode: custom.data.code })

    throw createError({ statusCode: 404, statusMessage: 'Page not found' });
}

```

Import
------

[](#import)

A CSV of redirects can be imported by uploading the CSV to: `/storage/redirect-import.csv`

The CSV should be in this format;

```
from, to, group, code, siteId

```

Where:

```
group = A free text grouping of the redirects in the CMS
code = The status code, likely either 301 or 302

```

Once uploaded, navigate to the following url in the CMS:

```
/admin/customredirects/import

```

Multisite Support
-----------------

[](#multisite-support)

This plugin supports multiple sites. When calling the endpoint, set the CMS base url to include your site handle. For example:

```
/de/rest/v1/redirect

```

To Do
-----

[](#to-do)

- Create CMS interface for CSV upload
- Consider GraphQL query support

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 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

Every ~68 days

Total

4

Last Release

612d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c7a55d8f125fa768eb7683696289249e43c247d7f7a664300c96cda82697960f?d=identicon)[paul-blundell](/maintainers/paul-blundell)

![](https://www.gravatar.com/avatar/047191978f9f56ae6a15e0c8eb2e25bb925303a509ec8b339aa8156fb214e940?d=identicon)[nzimelimited](/maintainers/nzimelimited)

---

Top Contributors

[![nzimelimited](https://avatars.githubusercontent.com/u/10939047?v=4)](https://github.com/nzimelimited "nzimelimited (5 commits)")

### Embed Badge

![Health badge](/badges/futureactivities-craft-custom-redirects/health.svg)

```
[![Health](https://phpackages.com/badges/futureactivities-craft-custom-redirects/health.svg)](https://phpackages.com/packages/futureactivities-craft-custom-redirects)
```

###  Alternatives

[craftcms/element-api

Create a JSON API for your elements in Craft

503701.3k8](/packages/craftcms-element-api)[markhuot/craftql

A GraphQL implementation for Craft

31844.7k](/packages/markhuot-craftql)[wrav/oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.

36205.0k3](/packages/wrav-oembed)[imarc/craft-googlecustomsearch

A Craft plugin for integrating with Google's Custom Search (and Google's Site Search.)

2312.3k](/packages/imarc-craft-googlecustomsearch)[scaramangagency/craftagram

Grab Instagram content through the Instagram API

1426.0k](/packages/scaramangagency-craftagram)[dukt/twitter

Tweet field, search widget, embeds, and authenticated Twitter API requests.

1326.7k](/packages/dukt-twitter)

PHPackages © 2026

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