Here is my situation. I have one page (page 1) with entities in a long list displayed based on specific sorting. Then I have another page (page 2) with entities in a long list based on different sorting. There are many items on page 1, and one item of interest (can be any one of the many). The item of interest from page 1 also appears on page 2. Page 2 also has many items but none of the item of page 2 match the items of page one except the item of interest.
I want to have link to from the item of interest on page 1 to page 2. This allows the users to see similar items based on a different sorting. Since any item on page 1 could be the item of interest, each item will have such a link and each link will link to a different page.
The problem is the many to many relationship. Displaying the correct link for each item on the page would computationally expensive. So instead I have added a generic URLs with the object's id as parameter. When the link is clicked it does the lookup in the db to find the correct page and then redirects to the correct page. Strictly speaking I now have two URLs leading to the same content, and the total number of URL's has increased not just by double but by the number of items on a list (exponentially).
From an SEO perspective having these links is great as it promotes content discovery but the ballooning of URL's to duplicate content is horrible. What would be the best way to handle this? Should I block the generic URL in robots.txt (that is the URL that appears on with each list item). There goes content discovery. Or, should I add canonical link?
Also, is it a problem that each of these links is a redirect?