How do I redirect my <whatever page> to <whatever page>?
Customer Portal Pages
PHP is an easy and fast way to redirect your pages both permanently and temporarily.
When making a PHP redirect you need to make sure that you are putting the PHP code before the HTML tag including empty rows and spaces. So for example:
<HTML> <- this is wrong
header("HTTP/1.1 301 Moved Permanently");
<HTML> <- This is correct
The correct syntax is:
header ( string $string [, bool $replace = true [, int $http_response_code ]] )
So, in the int $http_response_code you could also use the 302 temporary redirect.
Another example using all the parameters on the same line would be:
<?php header("Location: https://<www.yourSiteHere.com>", true, 301); exit; ?>
Here is a link to the redirect manual page: http://php.net/manual/en/function.header.php
If you don't use the 301 line then your viewer will see a "Moved Temporarily" redirect instead of a 301. While this is not detrimental it is good coding practice and is more search engine friendly. (also note the " " not the ' ' ticks).