I have a codeigniter site ,that working perfectly when it is in http.
http
Then our client moved the site to new server which have the https securit
https
Try this
function redirectToHTTPS() { if($_SERVER['HTTPS']!="on") { $redirect= "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; header("Location:$redirect"); } }