I’m having this exact problem as well.
On mediatemple.
Is there a fix?
I too am on media template.
For the meantime, I implemented my own setting in functions.php
Basically, I check for a custom attribute called ‘ssl’ on my page, and if it exists, it redirects to the SSL page.
I am running into the same issue, also on Media Temple. @arashster can you post the function you are using?
Thanks!
function checkSsl() {
if (g('ssl') != '' && g('ssl') != 'off' && g('ssl') != '0' && $_SERVER['HTTPS'] != 'on') {
$vurl = "https://". $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
header("Location: " . $vurl);
die();
}
}
function g($attribute, $random=false, $page='') {
global $post;
global $post_attributes;
$return = '';
if ($page == '') {
$page = $post->ID;
}
if($post_attributes == '') {
$post_attributes = array();
}
if($post_attributes[$page] == '') {
$post_attributes[$page] = get_post_custom($page);
}
if (!$random) {
$return = $post_attributes[$page][$attribute][0];
} else {
$r = $post_attributes[$page][$attribute];
if (is_array($r)){
$x = array_rand($r);
$return = $post_attributes[$page][$attribute][$x];
}
}
return $return;
}
put the two functions in functions.php
g() is a shorthand function I use to get the custom attribute for the current page or any other page.
just put checkSsl() at the top of page.php or any other page template and it should redirect. Quick and dirty, I know.
[Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]