I can not understand your problem But for
SEO purpose,
For customizing url containing Id
You can do
#in model
def to_param
"#{id}-#{permalink}"
end
# controller
@product = Article.find(params[:id])
On Tue, Sep 20, 2011 at 7:07 AM, Alvaro Olivencia
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote:
> I''m having a problem related to duplicated content that I need to
solve.
>
> The problem is very simple, this url:
>
> mysite/spain/sevilla/title/171
>
> generates the same content like this one:
>
> mysite/spain-Upssss/sevilla-Upssss/title-Upssss/171
>
> The fact is that I''m finding the real content using:
>
> [code]
> Article.find_by_id(171)
> [/code]
>
> It means that country/region/title are not being evaluated when
> resolving the url, maybe this is good, but the problem is that google
> has indexed
> mysite/spain-Upssss/sevilla-Upssss/UserGeneratedTitle-Upssss/171
> and the right url as well.
>
> 1)I know that a canonical tag could be a solution, but how could I
> get/define the canonical href with the right url
> (mysite/spain/sevilla/title/171)?
>
> 2)Do you know about a rails plugin/gem to handle such situations ?
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.