The 2 most comment types of redirects are the permanent redirect (301) and the temporary redirect (302). There are some other types of redirects, but for the most part you should never need to use them. Introduced in HTTP 1.1 is a new temporary redirect (307). For now I would stay away from using it just in case a bot decides to crawl your site using HTTP 1.0 requests.
Permanent redirects are great if you have moved a page on a server or if you have moved to a new domain name. This way all of your page rank is transferred through to the new page. Using the permanent redirect is search engine friendly.
Temporary redirects are good for affiliate links or links that may change around from time to time. No page rank is passed through a temporary redirect.
Below are some examples of how to use PHP and .htaccess to achieve these redirects. But obviously, don’t stick all of those header() calls at the top of one page, you only need one. Also you can redirect off your domain to a new one as well, but remember to use a temporary redirect unless you know for sure it is a permanent move. Read more…