How to implement HTTPS in laravel 5.4

前端 未结 4 2119
孤城傲影
孤城傲影 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:34

    If you'd like to force HTTPS over all URLs of your app without having to change your Apache or Nginx configuration, you need to update your AppServiceProvider as followed:

    app['url']->forceScheme('https');
            }
        }
    }
    

    PS: you can remove the condition if you have SSL enabled on your local development environment.

提交回复
热议问题