After switching a paginated category to a page with a complete list of all entities on a single page, I noticed that Google still lists a certain page. It turns out that you can enter any page number and it does not make any difference. Works without complaints. Same on the home page which never had a pagination active. example.com/page:404
Not so on pages with a specific pagination, which behave like expected. I checked controllers and models and there is no pagination active on the pages in question. Any ideas, anyone?
Yes, if there is no active pagination, page:404
or any such pattern acts as a normal parameter, like tag: travel
etc.
Yeah, well, that’s even worse, actually. It should be a 404 in that case. Otherwise, it’s duplicate content, isn’t it?
Theoretically, yes, in practice, no, because as long as there is no such URL that a search engine could ever index, this will not happen. If Google has such URLs in their index, you can manually remove them if they are no longer valid, or add a route that returns a 404.
Really? Rather tweak Google than my own system?
As I outlined above, you have two options. And I think the easiest and quickest way to remove a result from Google search results is to use their removal tools.
Yes. I guess you are perfectly right.
'routes' => [
[
// 'pattern' => ['(:alphanum)):(:alphanum)', 'register/page:(:num)'], # error
'pattern' => 'foo/page:(:num)',
'action' => function () {
return false;
}
],
],
It would not be Kirby if that worked.
You cannot get the params or query strings via the pattern:
'routes' => [
[
'pattern' => 'notes',
'action' => function () {
if (kirby()->request()->params()->page()) {
return false;
}
$this->next();
}
],
],
That corrects for the pagination params, at least. Symptoms solved. Thank you.
If more of those fantasy URLs occur, I will adapt the .htaccess.