0
我正在使用laravel,我有一個問題將客戶重定向到https
和www
。 例如:CloudFlare SSL(htaccess)重定向到laravel上的index.php
到:https://www.domain.com/abc/def
這是我.htaccess
代碼:
RewriteCond %{HTTP:X-Forwarded-Proto} !https
# First rewrite to HTTPS:A
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
它已經重定向到https://www.
但它總是重定向到index.php
文件。
例如,而不是重定向到https://www.domain.com/abc
它重定向到https://www.domain.com/index.php