We are using header redirection here so above code is to be kept at top of the page and should execute before sending any output to browser.
Redirecting after some time lapse.
if($_SERVER['HTTPS']=='on'){
header ("Location: https://www.plus2net.com");
}else{
header( "refresh:5;url=https://www.plus2net.com" );
echo " You will be redirected after 5 sec , Or <a href=https://www.plus2net.com>Click here of you don't want to wait</a> " ;
}
After changing all urls to https: then your page address bar will look like this ( green https: with lock symbol saying that the data transmission to your browser is encrypted and secure )
Search and replace http: to https:
If your site stores URL in database tables , then you can use SQL Replace query to update all your http: to https: present in Links.
Here is the query you can use.
update `table_name` set column1=replace(column1,'http:' ,'https:') WHERE column1 like '%http:%'