$ composer require ctw/ctw-middleware-apex
Redirect apex domain to www domain. e.g. example.com
to www.example.com
.
This PSR-15 middleware redirects with an HTTP 301 ("Moved Permanently") Location header an apex domain to www e.g. example.com to www.example.com.
PHPBSD-3-Clause