I'm sure this can be configured on the server side, or even with the .htaccess file.
But, I'm looking for an option with php.
I have some domains that have ssl and non-ssl. I want to redirect any visitors that come to the non ssl page to be redirected to the ssl pages.
I've got this working for any urls that lack the "www." And then I redirect the visitors to the url with "www" in it.
<?
if (!strstr($_SERVER['HTTP_HOST'],"www.")){
header("Location: https://www.mysite.com/");
}
?>
I tried it with https, but it didn't recognize it.
Any ideas?