Hi,
I have a blogging system with pagination.
I want to get 404 if page is not found, for exemple page=21 if there are just 4 pages on the site.
In controller, if I just use go(‘error’), it performs a 302 redirect to 404 error page.
I don’t want this, I want to stay on same URL, so I found the first part of the solution :
if($kirby->request()->get('p') > $pagination->lastPage()){
$kirby->response()->code(404);
echo page('error')->render();
exit();
}
But response code is not 404.
Is it possible to get 404 response code with this solution ?
Thanks