ganeshXL’s example might work for you, but to further explain:
All URL’s generated by Wayfinder and $modx->makeUrl() function (unless specifically passed parameters to tell it otherwise) will always use the scheme (http:// or https://) that was used in the accessing request. In order to handle this, you need something like the ill-named snippet I mentioned (easier to manage which specific pages get redirected), or a similar plugin to always redirect requests to pages intended to be secure, or in this case insecure...
<?php
/**
* SSLRedirect
* A MODx plugin to force requests to certain pages to an SSL version.
*/
if ($modx->event->name == 'OnWebPageInit') {
if (isset ($insecurePages)) {
$insecurePages= explode(',', $insecurePages);
} else {
$insecurePages= array ();
}
if ($_SERVER['SERVER_PORT'] == 443 || (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'])=='on')) {
if (in_array($modx->documentIdentifier, $insecurePages)) {
$modx->sendRedirect($modx->makeUrl($modx->documentIdentifier, '', '', 'http'));
}
} else {
if (!in_array($modx->documentIdentifier, $insecurePages)) {
$modx->sendRedirect($modx->makeUrl($modx->documentIdentifier, '', '', 'https'));
}
}
}
?>
This uses a comma-delimited list of document ID’s from the plugin configuration, meant to NOT be served with https:// (I chose this approach when I implemented this code, because a majority of the pages on the site where this was used have to be served with https:// ). But it could just as easily be adjusted to work the other way around.
Note that this plugin is dependent on some makeUrl changes in 0.9.6.1 which allow you to specify the scheme as http or https specifically, in addition to the legacy approach using numeric values, or full.