helenp - 1:23 pm on Mar 25, 2013 (gmt 0) [edited by: helenp at 1:30 pm (utc) on Mar 25, 2013]
This code is good, essential even, however there is nothing in there to force any particular page to be http or https.
The usual method is to have www.example.com as http and store.example.com as https, or to define certain folders as https and the rest of the site as http. In your case, it is probably better to do the checking and redirecting from within your PHP script.
Not sure, but I think that it is what I am doing wich was posted in previous post.
I dont have any folder for https, but I link like this to the https pages: https://www.mysite/page.php
Then as an emergency solution I have added this to
all pages that should be http:
if ( $_SERVER['HTTPS'] )
$host = $_SERVER['HTTP_HOST'];
$request_uri = $_SERVER['REQUEST_URI'];
$good_url = "http://" . $host . $request_uri;
header( "HTTP/1.1 301 Moved Permanently" );
header( "Location: $good_url" );
and one if not https and good url = https on those pages that should be https.
Is this what you mean? thanks
[edited by: helenp at 1:30 pm (utc) on Mar 25, 2013]