Hallo zusammen,
ich habe einen shopware 6.7.4.0 shop der auf nginx läuft. Alles auf einem selbst verwalteten root server bei server4you.
In der google search console steht bei Indexierung:
“Indexierung zulässig? info Nein: „noindex“ wurde im HTTP-Header „X-Robots-Tag“ gefunden”
Ich habe die Konfigurationsdatei von nginx durchgesehen, dort ist kein noindex hinterlegt.
In der .env Datei steht:
APP_ENV=prod
APP_DEBUG=0
APP_URL=https://shop.meineurl.de
SHOPWARE_HTTP_CACHE_ENABLED=1
curl -I https://shop.meineurl.de ergibt:
HTTP/1.1 200 OK
Server: nginx/1.22.1
Content-Type: text/html; charset=UTF-8
Content-Length: 72401
Connection: keep-alive
Date: Mon, 01 Dec 2025 05:50:42 GMT
Strict-Transport-Security: max-age=31536000; includeSubDomains
x-frame-options: deny
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Age: 4312
Cache-Control: no-cache, private
Ich finde leider nich wo das “noindex” herkommen könnte.
Hat da noch jemand eine Idee was ich übersehen haben könnte? Ich bin aktuell einfach ratlos.
Gruß, Ralf.
Eher nicht aus Shopware. Schon mal die nginx Konfiguration komplett geprüft?
Danke Max_Shop,
ich habe nginx -T | grep -R „X-Robots-Tag“ eingegeben, gefunden hat es es in folgender Datei:
vendor/symfony/http-kernel/EventListener/DisallowRobotsIndexingListener.php: private const HEADER_NAME = ‚X-Robots-Tag‘;
Inhalt ist dort:
…
class DisallowRobotsIndexingListener implements EventSubscriberInterface{private const HEADER_NAME = ‚X-Robots-Tag‘;
public function onResponse(ResponseEvent $event): void
{
if (!$event->getResponse()->headers->has(static::HEADER_NAME)) {
$event->getResponse()->headers->set(static::HEADER_NAME, 'noindex');
}
}
public static function getSubscribedEvents(): array
{
return [
KernelEvents::RESPONSE => ['onResponse', -255],
];
}
}
Kann ich das einfach auskommentieren?
Ich habe diesen block einfach mal auskommentiert. Jetzt sagt die google search console: “URL ist für Google verfügbar”.
Auch curl -I https://shop.meineurl.de sagt jetzt:
HTTP/1.1 200 OK
Server: nginx/1.22.1
Content-Type: text/html; charset=UTF-8
Content-Length: 72401
Connection: keep-alive
Date: Mon, 01 Dec 2025 09:32:38 GMT
Strict-Transport-Security: max-age=31536000; includeSubDomains
x-frame-options: deny
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Age: 149
Cache-Control: no-cache, private
X-Robots-Tag: index, follow
Die Frage ist weshalb war das so? Wenn ich von APP_ENV=dev auf APP_ENV=prod umstelle, passiert das dann nicht automatisch, dass auf “index, follow” umgestellt wird?
Gruß, Ralf.
Wenn du DEBUG auf 1 gesetzt hast, dann setzt Symfony den Header automatisch:
->{$enableIfStandalone('symfony/scheduler', Schedule::class)}()
->end()
->end()
;
}
private function addRobotsIndexSection(ArrayNodeDefinition $rootNode): void
{
$rootNode
->children()
->booleanNode('disallow_search_engine_index')
->info('Enabled by default when debug is enabled.')
->defaultValue($this->debug)
->treatNullLike($this->debug)
->end()
->end()
;
}
private function addHttpClientSection(ArrayNodeDefinition $rootNode, callable $enableIfStandalone): void
{
nein, debug ist laut der .env Datei:
APP_DEBUG=0
Dann ist der Code Block die einzige Stelle in Symfony, die ich noch sehe:
'list' => $attribute->asList,
])->addTag('container.excluded', ['source' => 'because it\'s a streamable JSON']);
});
if (!$container->getParameter('kernel.debug')) {
// remove tagged iterator argument for resource checkers
$container->getDefinition('config_cache_factory')->setArguments([]);
}
if (!$config['disallow_search_engine_index']) {
$container->removeDefinition('disallow_search_engine_index_response_listener');
}
$container->registerForAutoconfiguration(RouteLoaderInterface::class)
->addTag('routing.route_loader');
$container->setParameter('container.behavior_describing_tags', [
'container.do_not_inline',
'container.service_locator',
'container.service_subscriber',
'kernel.event_subscriber',
Wenn disallow_search_engine_index nicht auf 0 gesetzt ist, dann wird der Subscriber nicht entfernt. Also fehlt das wohl in deinen Symfony ENV Variablen.
Danke dir, es funktioniert jetzt alles, nachdem ich den oben beschriebenen Abschnitt auskommentiert habe.
Gruß, Ralf.
Das dies notwendig war zeigt leider klar, dass in deiner Installation etwas nicht (mehr) mit den Konfigurationsdateien stimmt. Wollte dich nur darauf aufmerksam machen.