我有一个 Laravel 应用程序和一个.htaccess文件,用于将所有请求重定向到 HTTPS。然而,问题是,目前它总是重定向到 index.php 而不是正确的路由。
例如:
http://example.com/users/teams
应该重定向到:
https://example.com/users/teams
而是重定向到:
https://example.com/index.php
这是我的当前.htaccess:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteBase /
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
我一直在尝试玩弄它并寻找答案,但没有帮助。
Laravel 中没有设置中间件或任何东西来处理 HTTPS 重定向,因此那里不会有任何冲突。
qq_笑_17
精慕HU