We have a search page for a children's website with infinite scroll. For example we have the main URL (which receives the most traffic) like:
www.example.com/children/raincoats/
We show users up to 10 pages. The URLs look like:
www.example.com/children/raincoats/page-1
www.example.com/children/raincoats/page-2
www.example.com/children/raincoats/page-3
We also have query string parameters in URLs for filtering the results. For example:
www.example.com/children/raincoats/page-1/?color=blue&fabric=plastic
www.example.com/children/raincoats/page-2/?color=blue&fabric=plastic
We have kept "www.example.com/children/raincoats/" as canonical for all these URLs. Is it correct to use canonical? I read that canonical is to point to pages with the same content but these pages have different listings/content despite a similar look.
Currently we are having
rel="next"
link andrel="prev"
link on all such pages but if we get any such request we change ‘page-3’ to ‘page-1’ via JavaScript and fetch ‘page-1’ results. So if some hits "www.example.com/children/raincoats/page-3", the user/bot/crawler would be shown "www.example.com/children/raincoats/page-1" results. What harm could using JavaScript to handlerel="next"
have? Since ‘page-3’ and ‘page-1’ are different URLs showing the same results, would Google penalize us for doing this?Should ‘next’ and ‘prev’ rel links have all the query string (sort parameters)? If yes, how do I avoid them to be crawled since I want users to land on my main page through SEO "www.example.com/children/raincoats/page-1" and do not want its SEO juice to be split among pages.