donglipi4495 2017-02-23 14:52
浏览 107

使用htaccess将所有路由重定向到Laravel中的https / ssl

RewriteRule ^(.*)$ public/$1 [L]

How to redirect this (My site lies in subfolder)
How to redirect all the routes to be https ?

is this ok

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
  • 写回答

2条回答 默认 最新

  • douzhong4222 2017-02-23 14:59
    关注

    you can use this rule before your current one.

    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    
    评论

报告相同问题?