Jump to content


Photo

How to transfer webpages from HTTP to HTTPS


  • Please log in to reply
1 reply to this topic

#1 bluesapphire

bluesapphire
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 21 April 2006 - 03:01 PM

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

#2 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 21 April 2006 - 03:23 PM

[!--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) View Post[/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:

1.php
header("Location: https://mypage.com/1.php");
exit;

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

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

hope that helps a bit.
cheers
Mark
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users