how to redirect http to https

In the common scenario, most of the sites uses “http” protocol and you can see “http” in the browser’s address bar. But in the above scenario,we need to redirect the browser to “https” which means that “Hypertext Transfer Protocol over Secure Socket Layer”.
Ok let’s see a real example, type “” in browser after a while the “http” gets converted to “https” in address bar, which means this site is transferring the data over SSL protocal.

$redirect= “https://”.$_SERVER[‘HTTP_HOST’].$_SERVER[‘REQUEST_URI’];

Was this article helpful?