更改根目录并强制使用 https
Changing root directory and forcing https
我正在尝试更改我的 Laravel 应用程序的根目录,并在整个网站上取消 https。
这是我的 .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
# Point to public folder
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/ [L]
# Force https
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
它会更改根目录,但不会强制使用 https。如果我用另一种方式做,首先强制 https 然后设置到根目录,然后我得到太多重定向
编辑
解决方案是更改我的 Cloudflare 中的设置。 Cloudflare -> 'Crypto' 选项卡 -> SSL 到 'Strict'
解决方案是更改我的 Cloudflare 中的设置。 Cloudflare -> 'Crypto' 选项卡 -> SSL 到 'Strict'
我正在尝试更改我的 Laravel 应用程序的根目录,并在整个网站上取消 https。 这是我的 .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
# Point to public folder
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/ [L]
# Force https
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
它会更改根目录,但不会强制使用 https。如果我用另一种方式做,首先强制 https 然后设置到根目录,然后我得到太多重定向
编辑 解决方案是更改我的 Cloudflare 中的设置。 Cloudflare -> 'Crypto' 选项卡 -> SSL 到 'Strict'
解决方案是更改我的 Cloudflare 中的设置。 Cloudflare -> 'Crypto' 选项卡 -> SSL 到 'Strict'