codeigniter, force ssl on a particular page codeigniter, force ssl on a particular page codeigniter codeigniter

codeigniter, force ssl on a particular page


You need add Condition on .htaccess to make use SSL port work only for selected urls.

Here is example, how to do

RewriteEngine onRewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} controller/functionRewriteRule ^(.*)$ https://www.yourdomain.com/controller/function[R=301,L]RewriteCond %{SERVER_PORT} 443 RewriteCond %{REQUEST_URI} controller/functionRewriteRule ^(.*)$ https://www.yourdomain.com/controller/function[R=301,L]RewriteCond $1 !^(index\.php|images|robots\.txt)RewriteRule ^(.*)$ index.php/$1 [L] 

P.S : Your base_url must be set to “/” in your config file.For more information check http://codeigniter.com/wiki/SSL_Handling