tags:

views:

480

answers:

1

Hi!

I'm running a website hosted on Apache and Plone (based on Zope). My problem is that i have duplicate content with following urls:

www.site.com www.site.nl/en www.site.com/nl

and so on, every page shows the same content.

Google Webmaster Tools also reports sites in the following format to be duplicate:

www.site.nl/news www.site.nl/news/

Notice the trailing slash.

What's the best way to solve this (make a 301 redirect to the proper url)? Can i do this in the Plone source? Or should i use the canonical tag?

Regards

+2  A: 

Best place to solve it is in your apache configuration.

  1. Duplicate sites: choose one and permanently redirect the rest. For me, all www.reinout.vanrees.org traffic is redirected to reinout.vanrees.org.
  2. Trailing slashes: redirect URLs ending in / to their non-slash equivalents.

For (1), use this as an example:

<VirtualHost *>

ServerName www.reinout.vanrees.org

Redirect permanent / http://reinout.vanrees.org/

</VirtualHost>

For (2): you probably have big "virtualhostmonster" rewriterule at the end of your apache config. Copy/paste that line and use ^(.*)/$ instead of ^(.*) in the first one. That effectively strips trailing slashes.

Reinout van Rees