When manually running the queue from the ACP, the keyLocation submitted to IndexNow uses the ACP base url.
Got errors like these:
422 invalid_url Array
(
[host] => www.site.com/
[key] => 6c076eb62f3b43e8cf6c62a8d69dff7a
[keyLocation] => https://www.site.com/admin/<hash>.txt
[urlList] => Array
(
[0] => https://www.site.com/<url>
)
)
Issue is here:
$url = \IPS\Http\Url::internal('');
$data = array(
'host' => \IPS\Http\Url::baseUrl(\IPS\Http\Url::PROTOCOL_WITHOUT ),
'key' => \IPS\Settings::i()->indexnow_key,
'keyLocation' => (string) $url->setPath( $url->data[ \IPS\Http\Url::COMPONENT_PATH ] . $this->getKeyFileName() ),
'urlList' => $urls,
);
$url should specify the 'front' base
$url = \IPS\Http\Url::internal( '', 'front' );
Error happened in 4.6, but this file is not touched in 4.7.