How to implement HTTPS in laravel 5.4

前端 未结 4 2135
孤城傲影
孤城傲影 2021-01-23 03:28

I have a shared hosting with OVH(France) and i have the \"Let\'s Encrypt\" certificate for my domain.

however, i looked everywhere for redirecting all requests from HTTP

4条回答
  •  旧巷少年郎
    2021-01-23 04:29

    Without modify the .htaccess file, you can force the https protocol in your Laravel application adding:

    function boot() {
         URL::forceScheme('https');
         ... your code
    }
    

    In your AppServiceProvider.php.

提交回复
热议问题