【发布时间】:2019-03-05 15:12:18
【问题描述】:
我正在尝试更改我的 Laravel 应用程序的根目录,并在整个网站上使用 https。 这是我的 .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
# Point to public folder
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
# Force https
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
它会更改根目录,但不会强制使用 https。如果我用另一种方式做,首先强制 https 然后设置到根目录,那么我会得到太多重定向
编辑 解决方案是更改我的 Cloudflare 中的设置。 Cloudflare ->“加密”选项卡 -> SSL 到“严格”
【问题讨论】:
-
解决方案是更改我的 Cloudflare 中的设置。 Cloudflare ->“加密”选项卡 -> SSL 到“严格”