PHPackages                             restruct/silverstripe-intelligent-404 - 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. restruct/silverstripe-intelligent-404

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

restruct/silverstripe-intelligent-404
=====================================

Add additional smart redirection functionality to the existing 404 ErrorPage

4.0.0(7mo ago)037MITPHP

Since Sep 2Pushed 7mo agoCompare

[ Source](https://github.com/restruct/silverstripe-intelligent-404)[ Packagist](https://packagist.org/packages/restruct/silverstripe-intelligent-404)[ RSS](/packages/restruct-silverstripe-intelligent-404/feed)WikiDiscussions main Synced 1mo ago

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

Intelligent 404 Redirector for SilverStripe
===========================================

[](#intelligent-404-redirector-for-silverstripe)

### Forked here because the [original module](https://github.com/axllent/silverstripe-intelligent-404) is no longer actively maintained.

[](#forked-here-because-the-original-module-is-no-longer-actively-maintained)

An extension to add additional functionality to the existing 404 ErrorPage. If a 404 page is called, it tries to guess the intended page by matching up the last segment of the url to all SiteTree pages. It also uses soundex to match similar sounding pages to find other alternatives.

Other DataObjects (eg: products) can be added too provided they contain a `Link()` function

How it works
------------

[](#how-it-works)

If a 404 error is detected (**note:** does not work in `dev` mode by default):

1. It will search SiteTree for all matching URLSegments, as well as any that sound the same (using PHP's [soundex()](http://php.net/manual/en/function.soundex.php)).
2. If **1 exact** match is found, a 301 redirect is sent.
3. Else if **no exact** match is found, and **1 similar** page is found, a 301 redirect is sent to the similar page.
4. Else if more than 1 exact or similar page is found, a regular 404 page is shown and the list of possible options is shown (ie: "Were you looking for one of the following pages?") directly beneath it.
5. Else a regular 404 page is shown.

Configuration
=============

[](#configuration)

By default Intelligent-404 will just try match 404 pages with *all pages* in your SiteTree, except for pages with the classnames:

- `SilverStripe\CMS\Model\ErrorPage`
- `SilverStripe\CMS\Model\RedirectorPage`
- `SilverStripe\CMS\Model\VirtualPage`

This means that any page types you add should autmatically be included, and can optionally be excluded as well.

Generic options
---------------

[](#generic-options)

By default Intelligent-404 will not work in dev mode (to help you spot issues). You can turn this on by setting `allow_in_dev_mode: true`.

By default the module will also redirect is either 1 exact match or one potential match is found (eg: the page has been recreated elsewhere). You can change this by setting `redirect_on_single_match: false`.

```
Restruct\Silverstripe\Intelligent404\Intelligent404:
  allow_in_dev_mode: true           # allow this to work in dev mode (default false)
  redirect_on_single_match: false   # do not auto-redirect if one exact match is found (default true)
```

Adding other DataObjects
------------------------

[](#adding-other-dataobjects)

It is possible to add other DataObjects to the Intelligent-404 matching (such as a product database), provided that the DataObject has a `Link()` function. To add your own DataObjects, create a yml config (eg: `mysite/_config/intelligent404.yml`) with the following syntax:

```
Restruct\Silverstripe\Intelligent404\Intelligent404:
  data_objects:
    \Product:                   # must include the trailing \ for namespacing
      group: Products           # optional group to include the results list into (default 'Pages')
      filter:                   # optionally filter which results to include (see below)
        Stock:GreaterThan: 0
      exclude:                  # optional filter out results (see below)
        Expired: 1
```

Notes:
------

[](#notes)

### - Namespacing

[](#--namespacing)

Due to namespacing in SilverStripe 4, `data_objects` listed in your yaml files should include a training backslash `\`, so if your DataObject is `Product`, it should be references in your yaml config as `\Product`.

### Group (`group:`)

[](#group-group)

By default, all results will get passed on to your template as results of a `$Pages` ArrayList. You can optionally split your suggestion results (for instance for different ordering or templating) by adding a `grouping: `as in the example above. Then in your template you would do a `` in addition your your `$Pages`.

If you add your own grouping, please be sure to create your own `templates/Intelligent404Options.ss` to allow for those.

### Filter results (`filter:`)

[](#filter-results-filter)

You are able to filter the database field matches, for instance (in the example) products that have a `Stock` greater than `0`.

Please refer to the [Searchfilters documentation](https://docs.silverstripe.org/en/4/developer_guides/model/searchfilters/) for more information.

### Exclude results (`exclude:`)

[](#exclude-results-exclude)

You can also exclude database field matches, for instance (in the example) products that have a `Expired` of `1`.

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance68

Regular maintenance activity

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 67.1% 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 ~9 days

Total

4

Last Release

220d ago

Major Versions

3.0.2 → 4.0.02025-10-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d3680d6353e5f171543435b89965ba2588186ad7ec0ec97cbf572704fec2a4f?d=identicon)[micschk](/maintainers/micschk)

---

Top Contributors

[![axllent](https://avatars.githubusercontent.com/u/1463435?v=4)](https://github.com/axllent "axllent (47 commits)")[![micschk](https://avatars.githubusercontent.com/u/1005986?v=4)](https://github.com/micschk "micschk (17 commits)")[![xini](https://avatars.githubusercontent.com/u/1152403?v=4)](https://github.com/xini "xini (3 commits)")[![michalkleiner](https://avatars.githubusercontent.com/u/233342?v=4)](https://github.com/michalkleiner "michalkleiner (2 commits)")[![hubertusanton](https://avatars.githubusercontent.com/u/582188?v=4)](https://github.com/hubertusanton "hubertusanton (1 commits)")

---

Tags

silverstriperedirect

### Embed Badge

![Health badge](/badges/restruct-silverstripe-intelligent-404/health.svg)

```
[![Health](https://phpackages.com/badges/restruct-silverstripe-intelligent-404/health.svg)](https://phpackages.com/packages/restruct-silverstripe-intelligent-404)
```

###  Alternatives

[silverstripe/restfulserver

Add a RESTful API to your SilverStripe application

49545.2k4](/packages/silverstripe-restfulserver)[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

40975.2k15](/packages/nystudio107-craft-retour)[colymba/silverstripe-restfulapi

SilverStripe RESTful API with a default JSON serializer.

6328.8k](/packages/colymba-silverstripe-restfulapi)[fsasvari/laravel-trailing-slash

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

63164.3k](/packages/fsasvari-laravel-trailing-slash)

PHPackages © 2026

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