PHPackages                             krisell/redirect-www-middleware - 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. krisell/redirect-www-middleware

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

krisell/redirect-www-middleware
===============================

Redirects all requests using www to non www.

1.0.2(6y ago)0500MITPHP

Since Jul 3Pushed 6y agoCompare

[ Source](https://github.com/Krisell/redirect-www-middleware)[ Packagist](https://packagist.org/packages/krisell/redirect-www-middleware)[ RSS](/packages/krisell-redirect-www-middleware/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (3)Dependencies (2)Versions (5)Used By (0)

[![Build Status](https://camo.githubusercontent.com/f014a2a456136b9b8b21ebfc1a27697aa9670226d630a8d90fee166bc551777d/68747470733a2f2f7472617669732d63692e6f72672f4b726973656c6c2f72656469726563742d7777772d6d6964646c65776172652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Krisell/redirect-www-middleware)

Redirect WWW Middleware for Laravel
===================================

[](#redirect-www-middleware-for-laravel)

Provides a middleware which redirects all requests made to the www subdomain to the main domain. If possible, perform the redirect before the request hits your appliction instead of using this middleware (e.g. in Nginx, Apache or IIS config).

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

[](#installation)

```
composer require krisell/redirect-www-middleware
```

Usage
-----

[](#usage)

Register the middleware in `App\Http\Kernel`

```
protected $middleware = [
    ...,
    \Krisell\RedirectWWWMiddleware\Http\Middleware\RedirectWWW::class,
    ...,
];
```

License
-------

[](#license)

MIT

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

3

Last Release

2486d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25909128?v=4)[Martin Sandström Krisell](/maintainers/Krisell)[@Krisell](https://github.com/Krisell)

---

Top Contributors

[![Krisell](https://avatars.githubusercontent.com/u/25909128?v=4)](https://github.com/Krisell "Krisell (11 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/krisell-redirect-www-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/krisell-redirect-www-middleware/health.svg)](https://phpackages.com/packages/krisell-redirect-www-middleware)
```

###  Alternatives

[sailenicolas/forceutf8

PHP Class Encoding featuring popular Encoding::toUTF8() function --formerly known as forceUTF8()-- that fixes mixed encoded strings.

53282.3k](/packages/sailenicolas-forceutf8)

PHPackages © 2026

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