【问题标题】:Changing root directory and forcing https更改根目录并强制 https
【发布时间】: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 到“严格”

标签: laravel ssl https root


【解决方案1】:

解决方案是更改我的 Cloudflare 中的设置。 Cloudflare ->“加密”选项卡 -> SSL 到“严格”

【讨论】:

    猜你喜欢
    • 2016-07-05
    • 1970-01-01
    • 1970-01-01
    • 2017-06-07
    • 1970-01-01
    • 2023-03-03
    • 2013-07-12
    • 2011-05-10
    • 1970-01-01
    相关资源
    最近更新 更多