我正在尋找一個.htaccess文件,可以做到以下幾點,我設法讓每個功能工作單獨但不在一起。htaccess重定向所有的流量從http到https,但也重定向到index.php,這是隱藏一次https https:
要求無1: 所有HTTP通信重新定向到HTTPS
要求無2: 所有HTTPS的網址被引導到index.php url_params =
我或者與無端環上結束?或者我結束了服務器錯誤REQUEST_URI:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTPS} off
#RewriteCond %{HTTP:X-Forwarded-Proto} = http
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ ./index.php?url_path=$1 [L,NC,QSA]
因此,如果有人是輸入「http://www.example.com/page1」它會重定向到「https://www.example.com/page1」,然後「測試這種變化之前
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule^https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url_path=$1 [L,QSA]
清除瀏覽器緩存:「發送與第1頁發來的URL參數去的index.php
感謝
d
什麼是你的Apache版本,你是否支持一些代理或雲計算? – anubhava
vidahost共享 – Darcey