Welcome Guest, Not a member yet? Register   Sign In
How do I force https on live site, but not on local
#1

Hi there,

I have a site which requires the user to always use https but I don't want this to happen in my local development version as getting SSL to work locally has been a real hassle.

What would you recommend I do to have it force SSL in the live version, but not the local version?

Thanks!
Rob
Reply
#2

(09-02-2017, 05:04 PM)rob.maric Wrote: Hi there,

I have a site which requires the user to always use https but I don't want this to happen in my local development version as getting SSL to work locally has been a real hassle.

What would you recommend I do to have it force SSL in the live version, but not the local version?

Thanks!
Rob

https://www.codeigniter.com/user_guide/l...vironments

check the environments.
Reply
#3

Besides what you can do in CodeIgniter (basic configuration), you can force HTTPS on the live site by adding the following to your .htaccess file. Obviously only works for Apache type servers with mod rewrite enabled:


Code:
# Entire site is secure
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://example.com/$1 [R,L]
Reply




Theme © iAndrew 2016 - Forum software by © MyBB