From 8d6c8474edb62b27ac7bb8ff886a84748fd0fb5b Mon Sep 17 00:00:00 2001 From: Christopher Darling Date: Wed, 25 Jan 2023 21:13:55 +0000 Subject: [PATCH] ENH setPaginationTags should redirect ?start=0 not 404 Given ?start=0 should always be the first page, I think it's better UX to redirect to the parameterless URL rather than showing a 404 page. --- src/Model/Extension/SeoPageExtension.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Extension/SeoPageExtension.php b/src/Model/Extension/SeoPageExtension.php index cca598d..f8c24ef 100644 --- a/src/Model/Extension/SeoPageExtension.php +++ b/src/Model/Extension/SeoPageExtension.php @@ -715,14 +715,14 @@ public function getSitemapDate() * @param PaginatedList $list Paginated list object * @param array $params Array of $_GET params to allow in the URL // todo * - * @return string|404 response + * @return string|404|301 response **/ public function setPaginationTags(PaginatedList $list, $params = []) // @todo allowed { $controller = Controller::curr(); if($controller->getRequest()->getVar($list->getPaginationGetVar()) !== NULL) { if((int) $list->getPageStart() === 0) { - return $controller->httpError(404); + return $controller->redirect($controller->getRequest()->getUrl(), 301); } if($list->CurrentPage() > $list->TotalPages()){ return $controller->httpError(404);