1
如何重定向HTTP到HTTPS排除特定的網址是什麼?的.htaccess - 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一個存在的目錄? – starkeen
不,我使用codeigniter製作了這個網站。這是一個控制器名稱。 – Zuiche