PHPackages                             silverstripe/routewhitelist - 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/routewhitelist

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

silverstripe/routewhitelist
===========================

Provides a whitelist of known valid URL patterns in a SilverStripe website.

v1.0.1(10y ago)111.6k5[3 issues](https://github.com/silverstripe/silverstripe-routewhitelist/issues)[1 PRs](https://github.com/silverstripe/silverstripe-routewhitelist/pulls)BSD-3-ClausePHP

Since Mar 9Pushed 6y ago7 watchersCompare

[ Source](https://github.com/silverstripe/silverstripe-routewhitelist)[ Packagist](https://packagist.org/packages/silverstripe/routewhitelist)[ RSS](/packages/silverstripe-routewhitelist/feed)WikiDiscussions master Synced 4w ago

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

Route Whitelist
===============

[](#route-whitelist)

[![Build Status](https://camo.githubusercontent.com/e1efd5bbd2511ef308b9ebc97fd00984696a6c014b3ed120a82dbfdb3460952f/68747470733a2f2f7472617669732d63692e6f72672f73696c7665727374726970652f73696c7665727374726970652d726f75746577686974656c6973742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/silverstripe/silverstripe-routewhitelist)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/7b59a4afda529365f689c4311a4d2d3afb8bc32df7fc41eb34c24a0f40162b3b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73696c7665727374726970652f73696c7665727374726970652d726f75746577686974656c6973742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/silverstripe/silverstripe-routewhitelist/?branch=master)[![Build Status](https://camo.githubusercontent.com/3a9198ce0391e2d7d93c1b6b1d6bb914fba4f6b2da8769375104fcb04eff2f93/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73696c7665727374726970652f73696c7665727374726970652d726f75746577686974656c6973742f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/silverstripe/silverstripe-routewhitelist/build-status/master)[![codecov.io](https://camo.githubusercontent.com/4180c0b30fae6979eb1daeb7b63cc8a043b5e2d68935f8ea0819beb10d618309/68747470733a2f2f636f6465636f762e696f2f6769746875622f73696c7665727374726970652f73696c7665727374726970652d726f75746577686974656c6973742f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/github/silverstripe/silverstripe-routewhitelist?branch=master)

[![Latest Stable Version](https://camo.githubusercontent.com/ab8e9d18ab6beac88248d3d5199f8968e7b5bb93f39d14be0daf29368bce5b24/68747470733a2f2f706f7365722e707567782e6f72672f73696c7665727374726970652f726f75746577686974656c6973742f76657273696f6e)](https://packagist.org/packages/silverstripe/routewhitelist)[![Latest Unstable Version](https://camo.githubusercontent.com/83039f1ec9c0c683f820d2f613b3dd89947f72edfe5371a5484add65d7bf02b0/68747470733a2f2f706f7365722e707567782e6f72672f73696c7665727374726970652f726f75746577686974656c6973742f762f756e737461626c65)](//packagist.org/packages/silverstripe/routewhitelist)[![Total Downloads](https://camo.githubusercontent.com/bc1d40b2c97c9582d76f1895980de43784479a09484566e001579a8552a7a72b/68747470733a2f2f706f7365722e707567782e6f72672f73696c7665727374726970652f726f75746577686974656c6973742f646f776e6c6f616473)](https://packagist.org/packages/silverstripe/routewhitelist)[![License](https://camo.githubusercontent.com/d3bbdf2a38b615ccb6e0202211a9d85a03d33fafb9778639fd4bf58c721a74ea/68747470733a2f2f706f7365722e707567782e6f72672f73696c7665727374726970652f726f75746577686974656c6973742f6c6963656e7365)](https://packagist.org/packages/silverstripe/routewhitelist)[![Monthly Downloads](https://camo.githubusercontent.com/85c5b5691049ba4996cc2d00f08af029a30813b1ee35d4d496fa4f1fe011b307/68747470733a2f2f706f7365722e707567782e6f72672f73696c7665727374726970652f726f75746577686974656c6973742f642f6d6f6e74686c79)](https://packagist.org/packages/silverstripe/routewhitelist)[![Daily Downloads](https://camo.githubusercontent.com/3cf49d9f0c838faa223c34ca196cdfffd52d24536350bdedccbcbb2ca087171e/68747470733a2f2f706f7365722e707567782e6f72672f73696c7665727374726970652f726f75746577686974656c6973742f642f6461696c79)](https://packagist.org/packages/silverstripe/routewhitelist)

[![Dependency Status](https://camo.githubusercontent.com/18d41493172249810325eb606b7de3520ad399bccc971836475be16589ec0cec/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f73696c7665727374726970653a726f75746577686974656c6973742f62616467652e737667)](https://www.versioneye.com/php/silverstripe:routewhitelist)[![Reference Status](https://camo.githubusercontent.com/0f209ed498ae08862cd5cda0443218633b451a0303937caeec1ff1ffbf9f8014/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f73696c7665727374726970653a726f75746577686974656c6973742f7265666572656e63655f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/php/silverstripe:routewhitelist/references)

Provides a whitelist of known valid URL patterns in a SilverStripe website.

Overview
--------

[](#overview)

This module takes the approach that while routing is a difficult problem, there is a subset of the routing problem that is quite easy to solve. So, while is a very difficult computation involving multiple database queries to figure out if a given URL is invalid and should result in a 404, or is valid and should be routed to a certain controller, it is much easier to figure out that a given URL is definitely invalid and will under no circumstances result in a valid response. This module does exactly that. It examines the first segment of a URL and very quickly returns a 404 response, if that first segment doesn't match any known controller, route, or top-level page.

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

[](#requirements)

The Route Whitelist relies on the Apache's htaccess system to compare the first segment to the URL. Nginx is currently not supported.

Route Whitelist also only works with SilverStripe installations in the domain route. So, a site running at: "myawesomewebsite.com" works and "localhost:81" works, but "localhost/myawesomewebsite" doesn't work.

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

[](#installation)

To install this module run:

```
composer require silverstripe/routewhitelist:*

```

To configure the module replace the standard SilverStripe .htaccess file with the file in routewhitelist/extra/htaccess. You can do this by running the following commands:

```
cd myawesomewebsite
cp routewhitelist/extra/htaccess .htaccess

```

Then run a ?flush=all to generate the whitelist. Don't worry, the module doesn't take effect until you generate the whitelist.

If you have modified the standard SilverStripe .htaccess file, insert the following snippet into your modified file at an appropriate location near the top of the mod\_rewrite rules:

```
#routewhitelist: send known invalid URLs straight to the 404 error page
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/routewhitelistcache/.htaccess -f
RewriteCond %{REQUEST_URI} ^\/(.+?)(\/.*|\s*)$
RewriteCond %{DOCUMENT_ROOT}/routewhitelistcache/%1 !-f
RewriteRule  .* assets/error-404.html [L,R=404]

```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity64

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

Total

2

Last Release

3725d ago

### Community

Maintainers

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

![](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://avatars.githubusercontent.com/u/1168676?v=4)[Maxime Rainville](/maintainers/maxime-rainville)[@maxime-rainville](https://github.com/maxime-rainville)

---

Top Contributors

[![gordonbanderson](https://avatars.githubusercontent.com/u/7060?v=4)](https://github.com/gordonbanderson "gordonbanderson (3 commits)")[![caffeineinc](https://avatars.githubusercontent.com/u/270384?v=4)](https://github.com/caffeineinc "caffeineinc (1 commits)")[![chillu](https://avatars.githubusercontent.com/u/111025?v=4)](https://github.com/chillu "chillu (1 commits)")[![CreativeSynergy](https://avatars.githubusercontent.com/u/193625707?v=4)](https://github.com/CreativeSynergy "CreativeSynergy (1 commits)")[![olyism](https://avatars.githubusercontent.com/u/7202667?v=4)](https://github.com/olyism "olyism (1 commits)")

---

Tags

routessilverstripe404ddos

### Embed Badge

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

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

###  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

1321.1M83](/packages/silverstripe-userforms)[symbiote/silverstripe-advancedworkflow

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

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

Share draft page content with non-CMS users

21419.6k11](/packages/silverstripe-sharedraftcontent)[axllent/silverstripe-cms-tweaks

Several CMS usability improvements

1726.3k1](/packages/axllent-silverstripe-cms-tweaks)[nzta/silverstripe-sitebanner

Site-wide banners activated through the CMS

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

PHPackages © 2026

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