Looking to hire Laravel developers? Try LaraJobs

laravel-non-www-redirect maintained by redcenter

Description
A simple package to redirect non-www to www in your Laravel project.
Author
Last update
2025/11/21 12:55 (dev-master)
License
Downloads
843

Comments
comments powered by Disqus

Laravel non-WWW Redirect

Simple package to redirect non-www domains to www in your Laravel application.

Install

Install with composer
$ composer require redcenter/laravel-non-www-redirect

Adding middleware

Add the middleware class to your Kernel.php in App\Http:

    protected $middlewareGroups = [
        'web' => [
            ...
            LaravelNonWwwRedirectMiddleware::class,
            ...
        ],
    ];

Questions?

You can contact me through my website: redcenter.nl

Good bye!