Skip to main content

Posts

Showing posts from November, 2022

Magento 2: How to use redirect URl in Router.php

Module name - **Aks_CustomUrlRouter** You have to create below listed files 1. Registration.php :: app/code/Aks/CustomUrlRouter/registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Aks_CustomUrlRouter', __DIR__ ); ?> 2. Module.xml :: app/code/Aks/CustomUrlRouter/etc/module.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"> <module name="Aks_CustomUrlRouter" setup_version="2.0.0"></module> </config> 3. di.xml :: app/code/Aks/CustomUrlRouter/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">