.htaccess is surely the best way to do this, but you can also redirect traffic to https using PHP if(empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off"){ $redirect = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; header('HTTP/1.1 301 Moved Permanently'); header('Location: ' . $redirect); exit(); } Code (markup):
At the top of your PHP file(s). It impossible to tell which file exactly you need to add this code to, because only you know the structure of your files.