Skip to content

Middleware for Laravel 5, to redirect a HTTP to HTTPS, and a non-WWW to WWW

License

Notifications You must be signed in to change notification settings

areyi/RedirectToHttps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

RedirectToHttps

Middleware for Laravel 5, to redirect a HTTP to HTTPS, and a non-WWW to WWW

Features

  • Redirect HTTP to HTTPS
  • Redirect non-WWW to WWW
  • Compatible with Cloudflare

How to Use?

  • Copy Secure.php to /home/nexus/public_html/app/Http/Middleware/
  • Add this to /home/nexus/public_html/app/Http/Kernel.php under the $middleware array:
protected $middleware = [
    ...
    \App\Http\Middleware\Secure::class,
];
...
$request->headers->set('host', 'www.studionexus.co');
...

About

Middleware for Laravel 5, to redirect a HTTP to HTTPS, and a non-WWW to WWW

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages