.htaccess Laravel 5.2.HTA通道不工作

.htaccess Laravel 5.2.HTA通道不工作,.htaccess,laravel,laravel-5,digital-ocean,cloudflare,.htaccess,Laravel,Laravel 5,Digital Ocean,Cloudflare,我想从url中删除我的公用文件夹,并想强制http到https 我在用这个 RewriteEngine On RewriteRule ^(.*)$ public/$1 [L] RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://{REQUEST_URI} [L,R=301] 此代码仅适用于删除公用文件夹,但不适用于删除公用文件夹的http到https 1. Move the .htaccess file from public folder

我想从url中删除我的公用文件夹,并想强制http到https

我在用这个

RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://{REQUEST_URI} [L,R=301] 

此代码仅适用于删除公用文件夹,但不适用于删除公用文件夹的http到https

1. Move the .htaccess file from public folder to main folder.
then Rename the server.php to index.php
Now the myproject/public/ is changed to myproject/.
用于htaccess

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

我希望这对你有帮助。谢谢

您当前是否使用域或ip地址查看您的站点?