There are 2 ways to achieve this. Most would suggest using a plugin that rewrites all the URL’s every time the page is accessed (not sure if one exists) or you can edit your wp-config.php which is the quickest and most effective way.
Add the following to your wp.config.php file before the require_once
statement replacing /store/order/
with the page you want to secure.
if (($_SERVER['HTTPS'] == "on") && ($_SERVER['REQUEST_URI'] == '/store/order/')) {
define('WP_SITEURL', 'https://domain.com');
define('WP_HOME', 'https://domain.com');
}
else {
define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);
}
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
If WP_SITEURL
and WP_HOME
is already defined then you can comment those lines out by typing 2 forward slashes //
at the start of each line.
There is a caveat – when the HTTPS page is accessed, all links to the pages you wouldn’t want on HTTPS will use HTTPS but they will be redirected back to the HTTP. Hope this helps.