【发布时间】:2017-01-23 12:54:57
【问题描述】:
我的 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>
这给了我没有“公共”的好 URL,但有一种情况: 如果我去:
www.example.com
所以它总是使用 URL www.....如果我去:
https://www.example.com
它始终使用 URL https://....
我的问题: 无论我先输入 www 还是 https,如何使 URL 始终为 https://www.example.com?
【问题讨论】:
标签: .htaccess https laravel-5.2 web-hosting public