PDA

View Full Version : SSL Detection



Lapras
January 16th, 2003, 17:19
Hello, I have a question regarding SSL and PHP. I have a part of my website with SSL capabilities. the url being for example https://server.example.com/~myaccountusername/
Now this is different form my main page at http://www.example2.com . I am going to provide the link to the SSL page, but should a user find their way to the same page (not under SSL mode) at the normal http:// address is their a means with php I could redirect it to the ssl page?

CareBear
January 16th, 2003, 18:34
$_SERVER['SERVER_PORT'] will be equal to 80 for standard HTTP and 443 for SSL (standard ports)
You could check for 80 and use "header("Location: https://www.yourdomain.com/");" to make the browser redirect