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

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

silverstripe/redirectedurls
===========================

Provides a system for users to configure arbitrary redirections in the CMS

4.0.0(11mo ago)31540.5k↓21.5%54[12 issues](https://github.com/silverstripe/silverstripe-redirectedurls/issues)[1 PRs](https://github.com/silverstripe/silverstripe-redirectedurls/pulls)10BSD-3-ClausePHPPHP ^8.3CI passing

Since Dec 9Pushed 5mo ago7 watchersCompare

[ Source](https://github.com/silverstripe/silverstripe-redirectedurls)[ Packagist](https://packagist.org/packages/silverstripe/redirectedurls)[ RSS](/packages/silverstripe-redirectedurls/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (9)Dependencies (4)Versions (16)Used By (10)

Redirected URLs
===============

[](#redirected-urls)

[![Latest Stable Version](https://camo.githubusercontent.com/d0a49081b1aac221b3c512c75dbdb09ae2f8333b93381f568e09839e5b02c169/68747470733a2f2f706f7365722e707567782e6f72672f73696c7665727374726970652f7265646972656374656475726c732f76657273696f6e)](https://packagist.org/packages/silverstripe/redirectedurls)[![License](https://camo.githubusercontent.com/4850ed352b5611106ba4f70f58f0e472e310070a34b71080b782530a0ce99b8f/68747470733a2f2f706f7365722e707567782e6f72672f73696c7665727374726970652f7265646972656374656475726c732f6c6963656e7365)](https://packagist.org/packages/silverstripe/redirectedurls)[![Monthly Downloads](https://camo.githubusercontent.com/12cd61599eef4e370d5f13290af274f9fb9959888e398505c528e645a6d5a7b0/68747470733a2f2f706f7365722e707567782e6f72672f73696c7665727374726970652f7265646972656374656475726c732f642f6d6f6e74686c79)](https://packagist.org/packages/silverstripe/redirectedurls)

**Authors:**

- Sam Minnée
- Stig Lindqvist
- Russ Michell

This module provides a system for users to configure arbitrary redirections in the CMS. These can be used for legacy redirections, friendly URLs, and anything else that involves redirecting one URL to another.

The URLs may include query-strings, and can be imported from a CSV using the "Redirects" model admin included.

The redirection is implemented as a plug-in to the 404 handler, which means that you can't create a redirection for a page that already exists on the site.

Requirements
------------

[](#requirements)

- PHP `^8.2`
- Silverstripe CMS `^6`

Installation
------------

[](#installation)

- Use composer to run the following in the command line:

```
  composer require silverstripe/redirectedurls

```

- Then run **dev/build** ()

Usage
-----

[](#usage)

1. Click 'Redirects' in the main menu of the CMS.
2. Click 'Add Redirected URL' to create a mapping of an old URL to a new URL on your Silverstripe website.
3. Enter a 'From Base' which is the URL from your old website (not including the domain name). For example, "/about-us.html".
4. Alternatively, depending on your old websites URL structure you can redirect based on a query string using the combination of 'From Base' and 'From Querystring' fields. For exmaple, "index.html" as the base and "page=about-us" as the query string.
5. As a further alternative, you can include a trailing '/\*' for a wildcard match to any file with the same stem. For example, "/about/\*".
6. Complete the 'To' field which is the URL you wish to redirect traffic to if any traffic from. For example, "/about-us".
7. Alternatively you can terminate the 'To' field with '/\*' to redirect to the specific file requested by the user. For example, "/new-about/\*". Note that if this specific file is not in the target directory tree, the 404 error will be handled by the target site.
8. Create a new Redirection for each URL mapping you need to redirect.

For example, to redirect "/about-us/index.html?item=1" to "/about-us/item/1", set:

```
From Base:  /about-us/index.html
From Querystring:  item=1
To:  /about-us/item/1

```

Importing
---------

[](#importing)

1. Create a CSV file with the columns headings 'FromBase', 'FromQuerystring' and 'To' and enter your URL mappings.
2. Click 'Redirects' in the main menu of the CMS.
3. In the 'Import' section click 'Choose file', select your CSV file and then click 'Import from CSV'.
4. Optionally select the 'Replace data' option if you want to replace the RedirectedURL database table contents with the imported data.

CSV Importer, example file format:

```
FromBase, FromQuerystring, To
/about-us/index.html, item=1, /about/item/1
/example/no-querystring.html, ,/example/no-querystring/
/example/two-queryparams.html, foo=1&bar=2, /example/foo/1/bar/2
/about/*, ,/about-us

```

Allowing redirects from Asset URLs
----------------------------------

[](#allowing-redirects-from-asset-urls)

This assumes that your project as `silverstripe/assets`.

**Please note:** By default, many web services will route assets (and other resources) directly through Nginx. If this is the case for you, then please be aware that adding the following extension **will not be enough** to enable this functionality.

```
---
Name: app-redirectedurls
---
SilverStripe\Assets\Flysystem\FlysystemAssetStore:
  extensions:
    - SilverStripe\RedirectedURLs\Extension\AssetStoreURLHandler
```

### Routing assets through Apache

[](#routing-assets-through-apache)

This might differ for your web service, but you can use the following for any service that respect the `.platform.yml`configuration, and you can use this if you are using the latest Silverstripe `dev-boxes`.

#### Performance considerations

[](#performance-considerations)

Be very aware that Apache is slower than Nginx for serving static resources. Making this change could mean a significant impact to your application's performance.

#### Implementation

[](#implementation)

URL rules allow you to customise default behaviour:

```
url_rules:
  mysite:
    - '': ''
```

The regex must be in a format accepted by nginx. This will be used as a case-insensitive location matcher and is compared against the full URL.

- `^/assets/` - match all URLs pointing to the assets directory
- `\.(gif|jpg|jpeg)$` - match extensions at the end of the URL

For example, if you wanted to route all assets through Apache.

`platform.yml`:

```
url_rules:
  mysite:
    - '^/assets/': 'apache'
```

#### Some thoughts on limiting what assets are served from Apache

[](#some-thoughts-on-limiting-what-assets-are-served-from-apache)

Instead of serving all assets, is there are specific extension (or extensions) that you could call out? EG, is it only PDFs that you want to support redirect for?

```
url_rules:
  mysite:
    - '^/assets/.+\.(pdf)$': 'apache'
```

Or what about only serving a specific asset directory that you've specified with your content authors?

```
url_rules:
    mysite:
        - '^/assets/Documents/': 'apache'
```

###  Health Score

60

—

FairBetter than 98% of packages

Maintenance53

Moderate activity, may be stable

Popularity50

Moderate usage in the ecosystem

Community41

Growing community involvement

Maturity86

Battle-tested with a long release history

 Bus Factor3

3 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 ~276 days

Recently: every ~217 days

Total

15

Last Release

354d ago

Major Versions

1.0.2 → 2.0.02018-04-17

1.x-dev → 2.0.12019-03-21

2.x-dev → 3.0.02023-02-28

3.x-dev → 4.0.02025-07-14

PHP version history (3 changes)2.2.0PHP ^7.4 || ^8

3.0.0PHP ^8.1

4.0.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/654636?v=4)[Aaron Carlino](/maintainers/unclecheese)[@unclecheese](https://github.com/unclecheese)

![](https://www.gravatar.com/avatar/b0cba8b534e20e6ab4fff555a97b237a18436ebca1446fc0b29c8a8b504038b9?d=identicon)[GuySartorelli](/maintainers/GuySartorelli)

![](https://avatars.githubusercontent.com/u/111025?v=4)[Ingo Schommer](/maintainers/chillu)[@chillu](https://github.com/chillu)

![](https://www.gravatar.com/avatar/a25bc04c5720a36869d5a39c6449dde7eb43e19b7c8e666d5f632d6a9ab440b1?d=identicon)[emteknetnz](/maintainers/emteknetnz)

![](https://www.gravatar.com/avatar/afbb3dcc9ef29c1a6eedd6addcae5fce9ab1271915a85a4c349301b71237368d?d=identicon)[silverstripe-machine01](/maintainers/silverstripe-machine01)

![](https://www.gravatar.com/avatar/be6648e60fbab6f70bfc34dd8c14259562d28a47510a934ea9c01fe98633f3c2?d=identicon)[sminnee](/maintainers/sminnee)

![](https://avatars.githubusercontent.com/u/1168676?v=4)[Maxime Rainville](/maintainers/maxime-rainville)[@maxime-rainville](https://github.com/maxime-rainville)

---

Top Contributors

[![wilr](https://avatars.githubusercontent.com/u/101629?v=4)](https://github.com/wilr "wilr (17 commits)")[![dhensby](https://avatars.githubusercontent.com/u/563596?v=4)](https://github.com/dhensby "dhensby (16 commits)")[![tyrannosaurusjames](https://avatars.githubusercontent.com/u/3037783?v=4)](https://github.com/tyrannosaurusjames "tyrannosaurusjames (10 commits)")[![leighelse](https://avatars.githubusercontent.com/u/3152480?v=4)](https://github.com/leighelse "leighelse (4 commits)")[![andrewandante](https://avatars.githubusercontent.com/u/9702648?v=4)](https://github.com/andrewandante "andrewandante (4 commits)")[![phptek](https://avatars.githubusercontent.com/u/478440?v=4)](https://github.com/phptek "phptek (2 commits)")[![chillu](https://avatars.githubusercontent.com/u/111025?v=4)](https://github.com/chillu "chillu (2 commits)")[![satrun77](https://avatars.githubusercontent.com/u/166450?v=4)](https://github.com/satrun77 "satrun77 (2 commits)")[![stevie-mayhew](https://avatars.githubusercontent.com/u/1953220?v=4)](https://github.com/stevie-mayhew "stevie-mayhew (2 commits)")[![3Dgoo](https://avatars.githubusercontent.com/u/2616373?v=4)](https://github.com/3Dgoo "3Dgoo (2 commits)")[![camfindlay](https://avatars.githubusercontent.com/u/367847?v=4)](https://github.com/camfindlay "camfindlay (2 commits)")[![InnKlemenP](https://avatars.githubusercontent.com/u/67732215?v=4)](https://github.com/InnKlemenP "InnKlemenP (2 commits)")[![chrispenny](https://avatars.githubusercontent.com/u/505788?v=4)](https://github.com/chrispenny "chrispenny (2 commits)")[![oilee80](https://avatars.githubusercontent.com/u/1453382?v=4)](https://github.com/oilee80 "oilee80 (1 commits)")[![sanderha](https://avatars.githubusercontent.com/u/6941043?v=4)](https://github.com/sanderha "sanderha (1 commits)")[![tomaszpirc](https://avatars.githubusercontent.com/u/48201930?v=4)](https://github.com/tomaszpirc "tomaszpirc (1 commits)")[![UndefinedOffset](https://avatars.githubusercontent.com/u/1391558?v=4)](https://github.com/UndefinedOffset "UndefinedOffset (1 commits)")[![adrhumphreys](https://avatars.githubusercontent.com/u/10803137?v=4)](https://github.com/adrhumphreys "adrhumphreys (1 commits)")[![GuySartorelli](https://avatars.githubusercontent.com/u/36352093?v=4)](https://github.com/GuySartorelli "GuySartorelli (1 commits)")[![hdpero](https://avatars.githubusercontent.com/u/13778690?v=4)](https://github.com/hdpero "hdpero (1 commits)")

---

Tags

silverstriperedirecturlsredirectedurls

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[silverstripe/userforms

UserForms enables CMS users to create dynamic forms via a drag and drop interface and without getting involved in any PHP code

1371.1M85](/packages/silverstripe-userforms)[symbiote/silverstripe-advancedworkflow

Adds configurable workflow support to the CMS, with a GUI for creating custom workflow definitions.

46302.4k9](/packages/symbiote-silverstripe-advancedworkflow)[silverstripe/sharedraftcontent

Share draft page content with non-CMS users

21424.1k12](/packages/silverstripe-sharedraftcontent)[axllent/silverstripe-cms-tweaks

Several CMS usability improvements

1726.4k1](/packages/axllent-silverstripe-cms-tweaks)[axllent/silverstripe-trailing-slash

Ensure that a single trailing slash is always added to the URL

11188.5k5](/packages/axllent-silverstripe-trailing-slash)[nzta/silverstripe-sitebanner

Site-wide banners activated through the CMS

1038.7k](/packages/nzta-silverstripe-sitebanner)

PHPackages © 2026

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