【发布时间】:2016-06-09 08:26:23
【问题描述】:
如何将http重定向到https排除特定的url?
http://www.example.com/* => https://www.example.com/*
http://www.example.com/nonssl/* => http://www.example.com/nonssl/*
所以我按照以下方式制作 .htaccess 文件:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/nonssl/
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
但是当我转到http://www.example.com/nonssl/testfunc 时,它转到https://www.example.com/index.php/nonssl/testfunc。
提前致谢。
【问题讨论】:
-
/nossl 是一个存在的目录吗?
-
不,我使用 codeigniter 制作了这个网站。这是一个控制器名称。
标签: apache .htaccess http https