views:

156

answers:

1

I have been reading a lot about cloaking and redirects, and am wondering how this fits into rendering and layouts in Rails...

Two parts:

1) If I have different data formats to render in (json, xml, html, and iphone), and they all use the same url, differing by the ".format" at the end, is this considered "content duplication"? It seems like you could make the search engines unhappy with this. Is there a workaround/best-practice here?

2) If I render just the model template for rails, projects/index.html in one case, and render both the model template and the layout template in another, projects/index.html and layouts/application.html, and they are at different urls, is that considered content duplication? What's best practice in this case?


layout :main # or
layout :projects # or
layout :some_condition

I have read a little about canonicalization but I'm not quite sure how that fits into these cases.

What do you normally do in this situation to prevent being banned by the search engines?

Thanks for the tips.

+2  A: 
  1. No, this is not content duplication because you are serving the content in different formats. It would be content duplication if you would serve the same content in the same format at more than one URL.
  2. Yes, it could. But you need to provide more details in order to provide a more specific answer.

There are multiple solutions you can adopt:

Simone Carletti