JamesAB
01-06-2017, 02:51 PM
I'm looking to do something like this PHP code:
if ($_SERVER['SERVER_PORT'] != 443) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
exit();
}
But I would prefer to put it in individual templates because I only want to use it on a few pages.
Is there a "template friendly" version for similar code?
Or do I have to find a hook to place this sort of thing in?
if ($_SERVER['SERVER_PORT'] != 443) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
exit();
}
But I would prefer to put it in individual templates because I only want to use it on a few pages.
Is there a "template friendly" version for similar code?
Or do I have to find a hook to place this sort of thing in?