Magento 2 Redirect disabled product to other URL
Magento 2 Redirect Disabled Product To Other URL, You can achieve this functionality using override Magento\Cms\Controller\Noroute\Index controller Create di.xml filePath: app/code/VenderName/ModuleName/etc/di.xml <?xml version=”1.0″?> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:ObjectManager/etc/config.xsd”> <preference for=”Magento\Cms\Controller\Noroute\Index” type=”VenderName\ModuleName\Rewrite\Controller\Noroute\Index” /> </config> Create Index.php filePath: app/code/VenderName/ModuleName/Rewrite/Controller/Noroute/Index.php <?php /** * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace VenderName\ModuleName\Rewrite\Controller\Noroute; […]