2016-09-15 6 views
0

私のLaravelプロジェクトはすでに共有ホスティングサーバーに入っています(あなたは何を考えていますか...)。これは私に「公共」のない良好なURLのを与えるが、1つの場合があるhttpsを使用したLaravelパブリックフォルダへのhtaccess

<IfModule mod_rewrite.c> 
Options +FollowSymLinks 
RewriteEngine On 
</IfModule> 
# For all files not found in the file system, reroute the request to the 
# "index.php" front controller, keeping the query string intact 
<IfModule mod_rewrite.c> 
RewriteCond $1 !^(public) 
RewriteRule ^(.*)$ /public/$1 [L] 
</IfModule> 

::私が行く場合 は:

www.example.com 

ので、ルートフォルダ内に、私はこのコードを持っている.htaccessファイルを得ました私が行く場合、それは常に..... URLのWWWにとどまる:

https://www.example.com 

それは常にURLをhttpsでとどまる:// ....

私の質問: 最初にwwwやhttpsを入力すると、URLは常にhttps://www.example.comになりますか?

答えて

0

これは、実行する必要があります。

RewriteCond %{HTTPS} !=on 
RewriteRule^https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 
関連する問題