Fix sorting issues by redirecting. See #1858.