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.

Comments

Still getting 200 code

Hi,
I'm new to drupal, and have learned a lot from your site. Thanks for the great info.

I recently took over the SEO for a site, and gave aliases to the URLs as per your instructions here and for pathauto.

the new URLs are mysite/name (without the "content", which I removed from the URLs manually.

When I check the new url in http://www.searchenginepromotionhelp.com/m/http-server-response/code-che..., I still get a 200 code.

Any tips?

Thanks so much for your help,

Brian

This wonderful site

I just wanted to thank you for this informative website. I used Drupal for Dummies to get started and they suggested all the SEO modules to install but NOT how to use them. So I'm very happy to find all this info easy to access in one spot. SO much of creating a site in drupal for the first time is NOT step by step, which is where that book came in very handy. The drupal site has you running around in circles and back-tracking to find what you need, so finding this stuff in one spot is a huge relief! Thanks again!

I'm a Speaker at DrupalCon Portland