【发布时间】:2013-11-03 00:40:01
【问题描述】:
我正在使用以下 .htaccess 文件将某些页面重定向到 https://
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。有任何想法吗?
谢谢。
【问题讨论】:
标签: .htaccess codeigniter ssl