I am using codeigniter 3. How do I force SSL connection to my web pages so that all the pages are loaded with the green padlock icon beside it?
Note: How can I do this without having to edit htaccess file ?
I am using codeigniter 3. How do I force SSL connection to my web pages so that all the pages are loaded with the green padlock icon beside it?
Note: How can I do this without having to edit htaccess file ?
Codeigniter(GAE): best practice to redirect http to https in the ssl.php file:
Open config file from location
application/config/config.php
and enable or set hooks to true like this:Then create a new file named
hooks.php
inside theconfig
folder (i.e. application/config/hooks.php) and add the following code in it:Now create a new directory named
hooks
inside theapplication
folder (i.e. application/hooks) and then create a new file namedssl.php
inside thehooks
folder (i.e. application/hooks/ssl.php).Add the following code in the
ssl.php
file:Change
base_url
in your config:Redirect incoming traffic from
http
tohttps
: