Often we need to redirect permanently a page to a new location and this can be accomplished in many ways. I will discuss today the PHP method because this is the one i most often run into.
So you can make a header redirect with php in the following manner:
But keep in mind that this is a temporary redirect. If you need to make it a permanent (301) redirect then you need to add some additional code.
One method is to add an additional response code to the header redirect:
The other method is a bit longer:
header(‘HTTP/1.1 301 Moved Permanently’);
Both these methods do the same thing so its up to you which one to use.