eZ Community » Forums » Setup & design » How to avoid duplicate content for...

How to avoid duplicate content for search engines

How to avoid duplicate content for search engines

Tuesday 09 June 2009 10:39:50 am - 6 replies

Hi there,

I have some questions on search engine optimization. I did everything to avoid duplicate content on our site (e.g. 302 redirect from domain.com/article to www.domain.com/article) and everything works fine.

As you know, articles can be found within their "original view URL" and with their "nice URL". For example the same article can be found at:


I only use nice-URL in my links on the site, but for any reason google fetches the "original URL" in its index. And so we have a beautiful example for duplicate content....

So has anyone an idea, how to avoid this? The best solution would be a 302 redirect, if the original url is called - but i've no idea how to do ...

Thanks in advance,

Modified on Tuesday 09 June 2009 10:40:13 am by Michael F├╝rst

Tuesday 09 June 2009 5:56:33 pm

One way is to add a check at the top of the pagelayout.tpl that checks if the url in use is content/view/full/* and if it is, redirect instead to the node virtual url.

You will need a simple template operator that sends custom http headers for that.

Might be dangerous if you get stuck in loops, though.

Tuesday 09 June 2009 9:18:56 pm

If you worry about duplicate content use <link> tag to specify your preferred version of page (URL address).


Wednesday 10 June 2009 11:42:40 am


Another solution is to write a "content read" workflow event that checks the URL and redirects if necessary. It's quite close to Gaetano's solution but I find dirty to implement such a logic in a template operator.


Wednesday 10 June 2009 1:38:40 pm

Hi guys,

Thanks for your response.
I think the easiest way would be to define the <link> Tag.

But I'm really interested in the workflow solution. I read the documentation, but it is really short. Do you have a link to a manual or some tutorials about how to write and implement an own workflow event?

Thanks & regards,

Wednesday 10 June 2009 3:15:48 pm

Hi Mike,

you can start with eZpedia article [1] or look at an existing workflow event type [2].

For a "content read", you also have to enable the content_read operation, see settings/workflow.ini.

[1] http://ezpedia.org/ez/workflow_event_type
[2] http://projects.ez.no/types/ez_publish/workflow_event_type/

Thursday 18 June 2009 10:25:42 am

People, I'd recommend using this duplicate file finder - http://www.moleskinsoft.com/duplicate-file-finder-1
It can deal with unnecessary files on your hard drive. It has many functions, user-friendly interface, safety options and 100% efficiency.


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from