HTTPS |
Hi Guys,
What's the best practice to setup https on codeigniter 3.0.x. Any information / links would be great. Regards, IgnitedCMS
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
If you mean how to create certificates on server, it varies, depending on your hosting provider and server package. Also, some hosting companies auto-cert their accounts, so you wouldn't have to do anything extra, except handle $config['base_url'] dynamically.
Thank you for replying no I don't mean creating certificates, I mean specifically with codeigniter, do you just change the baseurl to https?
I don't know, I've never tried it. And do I need to change the htaccess file?
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
@ignitedcms,
Check with your host provider to see if they have cert's (if you want to purchase). Also, I know that there are free certificates too ( https://letsencrypt.org/ ). Install it on your server then simply set your config variable $config['base_url'] to https://
(09-10-2018, 12:39 PM)php_rocs Wrote: @ignitedcms, Thank you, I am using letsencrypt on plesk, however, do I need to change the htaccess file for all pages on my site and if so what?
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
@ignitedcms,
You should not have to change the htaccess file unless you customized it. The purpose of the cert is to encrypt the data going between the server and the user. Your privileges should not be affected.
(09-10-2018, 01:19 PM)php_rocs Wrote: @ignitedcms, Thank you for the explanation it is much clearer now, I also found this link to redirect any traffic coming from regular http links. https://stackoverflow.com/questions/4262...odeigniter
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
Got it. This is what I use on one of the most recent sites:
PHP Code: if (isset($_SERVER['HTTP_HOST'])) { Not sure if it works on all configurations, but I get by on my local XAMPP and production server. I guess long term it's not the most elegant solution, because it has to do a check and calculation for every request and it would be much better to just say base_url = X, but it works and probably doesn't affect the loads speed overall that much.
I use it
PHP Code: /* |
Welcome Guest, Not a member yet? Register Sign In |