Jump to content

Archived

This topic is now archived and is closed to further replies.

bluesapphire

How to transfer webpages from HTTP to HTTPS

Recommended Posts

Hi!
1 - How to verify tgrough PHP script that SSL certificate is successfully installed on server.
2 - If some one types "http://mypage.com/1.php" , then I want to redirect and change the url to secure server i.e; "https://mypage.com/1.php". How is it possible?

Kind Regards

Share this post


Link to post
Share on other sites
[!--quoteo(post=367208:date=Apr 21 2006, 04:01 PM:name=David Blix)--][div class=\'quotetop\']QUOTE(David Blix @ Apr 21 2006, 04:01 PM) [snapback]367208[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Hi!
1 - How to verify tgrough PHP script that SSL certificate is successfully installed on server.
2 - If some one types "http://mypage.com/1.php" , then I want to redirect and change the url to secure server i.e; "https://mypage.com/1.php". How is it possible?

Kind Regards
[/quote]

it really depends how your server/host is structured. for example, on my server - there are two directories. one for http files, and the other for https files. so in my http files folder (httpdocs), i just have something like:

[b]1.php[/b]
[code]
header("Location: https://mypage.com/1.php");
exit;
[/code]

however, using another way - my server ALSO sets an extra $_SERVER variable when under SSL:

[code]
if (!$_SERVER["HTTPS"])
{
   header("Location: https://mypage.com/1.php");
   exit;
}
[/code]
$_SERVER['HTTPS'] is set to 'on' when under SSL

hope that helps a bit.
cheers
Mark

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.