If you are going to upgrade, redesign, or change hosting of your website, you need to use a 301 redirect. Why?
Every single page of your website has a history on the internet. And there could be websites linking to your website using one of the many subpages of your website. Such as: www.yourdomain.com/help/frequently-asked-question.htm.
If you have your website redesigned with all new names like changing from the extension .html to .htm or .php, you need to make sure people do not end up at a “Page Cannot Be Found” error page- thus you may lose that visitor.
301 Redirects are preferred by search engines to ‘meta refesh’ code - which is inserted in the actual old page.
There are two was to do it.
The first is within each page by inserting the following code:
ColdFusion Redirect
<.cfheader statuscode=”301″ statustext=”Moved permanently”>
<.cfheader name=”Location” value=”http://www.new-url.com”>
PHP Redirect
<?
Header( “HTTP/1.1 301 Moved Permanently” );
Header( “Location: http://www.new-url.com” );
?>
ASP Redirect
<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”;
Response.AddHeader(”Location”,”http://www.new-url.com/”);
%>
ASP .NET Redirect
<script runat=”server”>
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = “301 Moved Permanently”;
Response.AddHeader(”Location”,”http://www.new-url.com”);
}
</script>
The second way is by editing the .htaccess file or simply…
1. Creating a new file called htaccess.txt
2. Adding the code for every page that will be redirected:
redirect 301 /oldpage.html http://www.new-url.com/newpage.php
3. Uploading the file to the root directory of the server.
4. Change the file name to “.htaccess” (remove the “.txt” and add a “.” at the beginning.
Powered by ScribeFire.

Although for seo purposes, it is best to keep the old URLs, there are situations that just can avoid dropping the URLs. 301 redirect is a good solution to inform search engines that you have moved your pages, you may be able to keep the PR or rankings if it is done well.