301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It’s not that hard to implement and it should preserve your search engine rankings for that particular page (including Google PR). If you have to change file names or move pages around, it’s the safest option. The code “301” is interpreted as “moved permanently”.
1. Login to cPanel and click the Redirects icon.
2. Leave the setting as 301 redirect, as this is preferred by search engines.
3. Select the appropriate domain name from the drop-down.
4. In the subsequent blank, enter an optional path and file name; this exact name must be typed to trigger the redirect.
5. In the large blank, enter the full URL for the redirect target; include http:// or https:// (e.g. http://speedhost.in)
6. Leave the other settings as they are, unless you know why you want to change them.
7. Click the Add button and you are done.
The above would make an entry directly to your .htaccess file. If you would like to do a 301 redirect in the .php file itself, then you can use the below code to accomplish the same.
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );
?>