CodeIgniter Forums

Full Version: .htaccess - redirect http to https exclude specific url
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to redirect http to https exclude specific url?

http://www.example.com/* => https://www.example.com/*

http://www.example.com/nonssl/* => http://www.example.com/nonssl/*


So I make .htaccess file following this:
Code:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/nonssl/
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

But when I go to http://www.example.com/nonssl/testfunc, it goes to https://www.example.com/index.php/nonssl/testfunc.

Thanks in advance.