krisell/redirect-www-middleware

Redirects all requests using www to non www.

1.0.2 2019-09-08 14:06 UTC

This package is auto-updated.

Last update: 2024-05-09 01:02:44 UTC


README

Build Status

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

composer require krisell/redirect-www-middleware

Usage

Register the middleware in App\Http\Kernel

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

License

MIT