1
我用下面的.htaccess文件中的某些網頁重定向到https://
笨的.htaccess用於SSL文件插入的index.php
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} (sale|success|cancel)
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301]
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !(static|sale|success|cancel)
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301]
RewriteCond $1 !^(index\.php|resources|robots\.txt|static)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
這工作,除了當你去到被重寫頁面https://
它也在URL中插入index.php
。一切工作正常,但我希望index.php
不被插入。有任何想法嗎?
謝謝。
謝謝,雖然沒有解決問題。 – GluePear
在其他瀏覽器中測試以避免301緩存問題。 – anubhava
是的,你是對的。非常感謝anubhava。 – GluePear