Fix Duplicate Content with Global Redirect Module

The Drupal path and pathauto modules are great, but also can cause us some problems. Google does not like it when more than one URL yields the same results. The path and pathauto modules allow us to create an alias for our content. So, instead of using "node/15" in our URL, we can use something more descriptive like "content/cool-seo-article".

But what happens if we have a link to node/15 somewhere on our site? If you only have path and pathauto installed, node/15 will simply show the same content as "content/cool-seo-article". This is very BAD because now you have duplicate content on your site!!!.

How can you check if this is the case? You can use a http status checker like: http://www.searchenginepromotionhelp.com/m/http-server-response/code-checker.php. The steps would be:

1) make an alias for a page
2) try going to it with the node/[nid] url
3) try going to it with the [url-alias] url
4) paste url from #2 into the status checker above and see what the response code is

A response code of 200 is bad for node/[nid]. It means that it's just returning the content even though there is another URL that will show the same thing. What you want is a response code of 301 for "permanent redirect". What this will tell the browser is that, while the URL passed in is valid, there is a new URL to use.

How do you get Drupal to do the right thing? Use the Global Redirect module and it will fix the problem for you.

1) download Use the Global Redirect module
2) enable at admin/build/modules (in the "Other" section)
3) re-check your node/[nid] url with the status checker

Now you should have a 301 response code!

You can also modify your .htaccess to prevent the search engines from seeing any pages like node/[nid]. This is a fine strategy if you are going to make sure to alias *everything* on the site. But, if for some reason, you'd rather have some links as node/[nid] and others aliased, just use the Global Redirect module.