PHPackages                             nglasl/silverstripe-misdirection - 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. nglasl/silverstripe-misdirection

ActiveSilverstripe-vendormodule[HTTP &amp; Networking](/categories/http)

nglasl/silverstripe-misdirection
================================

This module allows both simple and regular expression link redirections based on customisable mappings, either hooking into a page not found or replacing the default automated URL handling.

3.2.0(1y ago)477.6k↑164.3%7[4 issues](https://github.com/symbiote/silverstripe-misdirection/issues)[2 PRs](https://github.com/symbiote/silverstripe-misdirection/pulls)1BSD-3-ClausePHP

Since Dec 3Pushed 1y ago2 watchersCompare

[ Source](https://github.com/symbiote/silverstripe-misdirection)[ Packagist](https://packagist.org/packages/nglasl/silverstripe-misdirection)[ Docs](https://github.com/symbiote/silverstripe-misdirection)[ RSS](/packages/nglasl-silverstripe-misdirection/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (2)Versions (62)Used By (1)

[misdirection](https://packagist.org/packages/nglasl/silverstripe-misdirection)
===============================================================================

[](#misdirection)

*The current release is **3.1.1***

> This module allows both simple and regular expression link redirections based on customisable mappings, either hooking into a page not found or replacing the default automated URL handling.

Requirement
-----------

[](#requirement)

- Silverstripe 3.1, 4 or 5

This module does **not** require the CMS.

Getting Started
---------------

[](#getting-started)

Install the module using composer:

```
composer require nglasl/silverstripe-misdirection dev-master

```

Then run dev/build.

Select `Misdirection` through the CMS and create a link mapping.

Overview
--------

[](#overview)

### Link Mappings

[](#link-mappings)

These allow both simple and regular expression link redirections, and can be used for legacy page redirection, vanity URLs (more below), or redirection based on specific URL patterns.

[![link-mapping](https://raw.githubusercontent.com/nglasl/silverstripe-misdirection/master/client/images/misdirection-link-mapping.png)](https://raw.githubusercontent.com/nglasl/silverstripe-misdirection/master/client/images/misdirection-link-mapping.png)

The link mapping with the highest priority (followed by greatest specificity) will be used, and replaces the default automated URL handling out of the box. This default behaviour may be configured to only hook into a page not found:

```
nglasl\misdirection\MisdirectionRequestFilter:
  enforce_misdirection: false
```

When there are multiple matches, the link mapping first created will be used. This default behaviour may be configured to prioritise the link mapping most recently created:

```
nglasl\misdirection\LinkMapping:
  priority: 'DESC'
```

### Vanity URLs and Fallbacks

[](#vanity-urls-and-fallbacks)

[![vanity-URLs-and-fallbacks](https://raw.githubusercontent.com/nglasl/silverstripe-misdirection/master/client/images/misdirection-vanity-URLs-and-fallbacks.png)](https://raw.githubusercontent.com/nglasl/silverstripe-misdirection/master/client/images/misdirection-vanity-URLs-and-fallbacks.png)

#### Vanity URLs

[](#vanity-urls)

While it is possible to create these manually (as above), a content author may directly create a link mapping from a page. However, it should be noted that these are instantiated with a low priority of `2`, and therefore other link mappings with higher priority will take precedence.

#### Fallbacks

[](#fallbacks)

When a user happens to encounter a page not found, a specified rule may be triggered to prevent displaying this. It is possible for an administrator to configure a global fallback through the site configuration, however a specific page setting will take precedence.

- Select `Settings`
- Select `Pages`

### What's Happening?

[](#whats-happening)

The link mappings are processed server side to prevent inefficient and problematic mappings, using a request filter.

When you want to see exactly what is happening behind the scenes for a given URL, the model admin provides a powerful testing interface!

[![testing](https://raw.githubusercontent.com/nglasl/silverstripe-misdirection/master/client/images/misdirection-testing.png)](https://raw.githubusercontent.com/nglasl/silverstripe-misdirection/master/client/images/misdirection-testing.png)

Once a maximum number of requests has been reached, the server will respond with a page not found. The following is the default configuration:

```
nglasl\misdirection\MisdirectionRequestFilter:
  maximum_requests: 9
```

[![testing-maximum-requests](https://raw.githubusercontent.com/nglasl/silverstripe-misdirection/master/client/images/misdirection-testing-maximum-requests.png)](https://raw.githubusercontent.com/nglasl/silverstripe-misdirection/master/client/images/misdirection-testing-maximum-requests.png)

#### Bypassing Misdirection

[](#bypassing-misdirection)

It is possible to bypass the request filter completely by appending `?misdirected=1` to the URL. This is fantastic for debugging, however does not apply to the testing interface for obvious reasons.

### Default Automated URL Handling

[](#default-automated-url-handling)

This may be completely replaced, in which case legacy URLs will no longer resolve based on page version history.

```
nglasl\misdirection\MisdirectionRequestFilter:
  replace_default: true
```

When a page is moved, the appropriate link mappings are automatically created and maintained. This allows full control over which legacy URLs remain in the system.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~61 days

Recently: every ~541 days

Total

61

Last Release

536d ago

Major Versions

1.0.x-dev → 2.0.02015-09-08

2.2.x-dev → 3.0.02018-05-08

2.3.0 → 3.1.12019-02-11

2.3.1 → 3.2.02025-01-14

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23506857?v=4)[Symbiote](/maintainers/symbiote)[@symbiote](https://github.com/symbiote)

---

Top Contributors

[![JamesDPC](https://avatars.githubusercontent.com/u/69664712?v=4)](https://github.com/JamesDPC "JamesDPC (5 commits)")[![nyeholt](https://avatars.githubusercontent.com/u/161730?v=4)](https://github.com/nyeholt "nyeholt (3 commits)")[![wilr](https://avatars.githubusercontent.com/u/101629?v=4)](https://github.com/wilr "wilr (3 commits)")[![xini](https://avatars.githubusercontent.com/u/1152403?v=4)](https://github.com/xini "xini (2 commits)")[![fonsekaean](https://avatars.githubusercontent.com/u/143939?v=4)](https://github.com/fonsekaean "fonsekaean (1 commits)")

---

Tags

urlsilverstripemappingredirectredirection404link mappingpage not foundhttp 404

### Embed Badge

![Health badge](/badges/nglasl-silverstripe-misdirection/health.svg)

```
[![Health](https://phpackages.com/badges/nglasl-silverstripe-misdirection/health.svg)](https://phpackages.com/packages/nglasl-silverstripe-misdirection)
```

###  Alternatives

[silverstripe/framework

The SilverStripe framework

7313.7M2.8k](/packages/silverstripe-framework)[silverstripe/cms

The SilverStripe Content Management System

5253.6M1.4k](/packages/silverstripe-cms)[nystudio107/craft-retour

Retour allows you to intelligently redirect legacy URLs, so that you don't lose SEO value when rebuilding &amp; restructuring a website

401.0M18](/packages/nystudio107-craft-retour)[fsasvari/laravel-trailing-slash

The package that adds redirection with trailing slash to Laravel framework.

61171.8k](/packages/fsasvari-laravel-trailing-slash)[silverstripe/admin

SilverStripe admin interface

262.8M385](/packages/silverstripe-admin)

PHPackages © 2026

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