Ease customisation of redirect handling for product and category views

@mbertheau suggested a likely use case for having individual URLs for
product variants in #1376. This commit moves away from the suggested
syntax, but gives an easy hook to customise the redirect handling.

Fixes #1376.