Page 1 without page param
AnubixXx opened this issue · 2 comments
Hi,
is there possibility to change ?page=1 param in will_paginate helper? I explain it, i have the url:
www.mywebsite.com/t-shirts
and pagination is
www.mywebsite.com/t-shirts?page=1
www.mywebsite.com/t-shirts?page=2
www.mywebsite.com/t-shirts?page=3
But page=1 is same as www.mywebsite.com/t-shirts. So there is duplicity because of SEO. In menu I just link to www.mywebsite.com/t-shirts, but pagination helper will_paginate is still redering link to page=1. Is there a way to change to remove page=1 param without routing?
Thanks.
Closing in favor of the linked solution. In short: you can't avoid ?page=1
, but you can subclass LinkRenderer and override the URL generation logic in any way you please
will_paginate/lib/will_paginate/view_helpers/action_view.rb
Lines 108 to 119 in ccaba92