[英].htaccess HTTPS redirects working but HTTPS going to /index.php
[英]All my .htaccess redirects are going to index.php
我正在嘗試使用.htaccess文件將所有網站流量從任何URL重定向到https://,安全ssl。 這必須匹配當前域並重定向,包括任何子URL。
我的代碼:
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTP_HOST} ^shop.test.com$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
我遇到的問題是所有流量都被發送到index.php
shop.test.com/testurl
轉到-https: //shop.test.com/index.php
預期-https: //shop.test.com/testurl
這很可能是由於另一條規則將所有內容寫入index.php
並將其用作前端控制器。
確保將規則放在第一個規則之上,位於RewriteEngine On
在線下面。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.