[英]Redirect HTTP to HTTPS using an .htaccess file
我將ht-access文件更改為
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
當我進入首頁示例時:
www.xyz.com
它將重定向為https://www.xyz.com/
我的問題是,當我加載www.xyz.com/about
它不會進行https://www.xyz.com/about
。 它顯示了www.xyz.com/about
。 如果有任何建議,請更改我的htaccess文件以使其正常工作。
將https重定向放在開頭。 [L]
告訴apache這是最后一條指令,所以您的行
RewriteRule . /index.php [L]
將是使用的最后一行。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.