Fixing duplicate content using redirection 301
Last Updated on Tuesday, 12 June 2012 13:40
Fixing duplicate content using "canonical redirect"
There is nothing more embarrassing in the world of SEO than duplicate content. If you are caught with duplicate content, it’s a one-way ticket to Internet detention in the eyes of Google. Sure, the first few times you walk away with a sore wrist and your content taken down. But if you continue to consciously duplicate your content, your website could be wiped away from Web existence. Now that’s heavy.
It is really critical to eliminate duplicate content as soon as possible. Let's imagine you have www.java-tutorial.ch and java-tutorial.ch returning the same content. google will consider that as duplicate content and if you have the good idea to link your website using both link you a splitting the potential benefit of valuable link popularity.
Using 301 redirect
Our recommendation is to use a server side 301 redirect. This is the best way to ensure that users and search engines are directed to the correct page. The 301 status code means that a page has permanently moved to a new location.
How To Enable The 301 Redirect
Enable the redirection is quite simple and can be done in three steps :
- Enabling the rewriting module in Apache
- Creating a .htaccess file to implement the rule
- Defining the rewriting rule
Enabling the rewriting module
The rewriting module in Apache is called mod_rewrite. In order to use mod_rewrite you can type the following command in the terminal:
The Apache server’s mod_rewrite module gives you the ability to transparently redirect one URL to another, without the user’s knowledge. This opens up all sorts of possibilities, from simply redirecting old URLs to new addresses, to cleaning up the ‘dirty’ URLs coming from a poor publishing system — giving you URLs that are friendlier to both readers and search engines.
To check if the module has been loaded your can execute the following command to list the modules
Creating a .htaccess file to implement the rule
Put a .htaccess file in your root so that rewriting is enabled throughout your site. You only need to write this snippet once per .htaccess file.
Defining the rewriting rule
Once you've done that simply add the following code to the .htaccess file.This code will tell your site to redirect any visitors who visit your site without inputting the WWW to your WWW domain.
The technical term for this type of redirect is "Canonical Redirect".
You can now restart your apache server then enter your web site url without the www in the following website form.
You should receive the following response :
Tags: content, apache, link, duplicate, rewriting, module, website