Use 301 Redirects to Avoid Duplicate Content

By November 13, 2014 Web Design No Comments

Have you ever found that you have more than one page of information that is almost exactly like another?  Maybe you’ve redesigned your site and orphaned a couple of pages which then were rebuilt with the exact same content under new file names.

Using a 301 Redirect will help you keep the value of the old “orphaned” pages and redirect that value to the new pages that have replaced them.  * Remember, duplicate content is a huge no-no to the search engines and will prevent your site from attaining good keyword ranking.

Depending on the server platform your website is hosted on and the programming language used to create your site, you have a lot of different options for setting up 301 redirects.

Here are the primary methods for the most common programming languages / server platforms:

.htaccess 301 Redirect
This is the most common redirect method used on Linux servers with the “mod-rewrite” module.  Simply download or create a file (using a text editor) called .htaccess.  Add the line below to the text file, save upload to the root directory of your site and you’re done.

Redirect an old page to a new page:
redirect 301 /old/old.html http://www.yourdomain.com/new.html

Redirect an old page to a new folder/category:
redirect 301 /old/old.html http://www.yourdomain.com/folder/

PHP 301 Redirect
<?
Header( “HTTP/1.1 301 Moved Permanently” );
Header( “Location: http://www.new-url.com” );
?>

.NET 301 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>

Ruby 301 Redirect
def old_action
headers[“Status”] = “301 Moved Permanently”
redirect_to “http://www.new-url.com/”
end

Cold Fusion
<.cfheader statuscode=”301? statustext=”Moved permanently”>
<.cfheader name=”Location” value=”http://www.new-url.com”>