krisell / redirect-www-middleware
Redirects all requests using www to non www.
Installs: 500
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/krisell/redirect-www-middleware
Requires (Dev)
- orchestra/testbench: ^3.5
- phpunit/phpunit: ^8.2
This package is auto-updated.
Last update: 2025-10-09 03:51:58 UTC
README
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