Laravel: how to force HTTPS? Laravel: how to force HTTPS? laravel laravel

Laravel: how to force HTTPS?


You need adding this to your .htaccess file:

RewriteCond %{SERVER_PORT} 80RewriteRule ^(.*)$ https://YOURWEBSITEDOMAIN/$1 [R,L]

See this:http://www.inmotionhosting.com/support/website/ssl/how-to-force-https-using-the-htaccess-file


Try adding this code in your .htaccess file.

RewriteEngine OnRewriteCond %{HTTPS} !=onRewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


When you want to Render all URLs with https the simplest method is touse the code below in the boot() function of app/Providers/AppServiceProvider.php:

\URL::forceScheme('https');