Question

I redirecting 404 not found page to product page using controller_action_predispatch_cms_noroute_index event observer.

Observer:

$request = $observer->getData('request');
$request->initForward();
$params = ['id' => $productId, 'category' => $categoryId];
$request->setParams($params)
    ->setModuleName('catalog')
    ->setControllerName('product')
    ->setActionName('view')
    ->setDispatched(false);

Product page loading perfectly but 404 not found page also loaded with it.

Does anyone have an idea?

Pas de solution correcte

Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange
scroll top