7
I just want to make sure what you are asking for.
As I read this, it sounds to me that you want to intercept a URL
XOOPS_URL/?page=23
and have that instead result in an HTTP error, such as 404.
Is that correct?
Here are a few general observations.
While the link that is causing the issue is wrong, it is not technically an error. The custom error pages don't get called, as there is no HTTP error triggered. (The front page is found, and passed a query string it ignores.)
Something is creating the links that google follows. Until you find a correct that, there will still be a problem somewhere. Has anything been updated recently? As an example, I saw a module before with a XoopsPageNav error that generated links that looked a lot like this.
Goffy's suggestion about the search console sounded worthwhile.
Seeing the referrer for one of these problem URLs would pinpoint the actual source of the problem.
As a temporary solution, you could patch the XOOPS_ROOT_PATH/index.php
Adding this code on the next line after the opening "
if (!empty($_GET)) {
if (!empty($_SERVER['HTTP_REFERER'])) {
@file_put_contents(__DIR__ . '/queryurllog.txt', $_SERVER['HTTP_REFERER'] . "n", FILE_APPEND);
}
http_response_code(404);
exit;
}