Hello,
I want to use the secure protocol https if available, so anyone requesting http://mydomain.net/login.php is redirected to https://mydomain.net/login.php
if (getenv("HTTPS") == 'on')
{
header ("Location: [url]https://[/url]".$SERVER['HTTP_HOST'].$SERVER['PHP_SELF']);
exit ();
}
In MSIE I get an error stating problems with redirections, while Opera seems to be endlessly refreshing the page.
Question 1: What's wrong with my script?
Q2: Is there a way to know whether the browser requested a URL starting with https or not?
Thanks in advance!