magento index rewright url create February 16, 2015/0 Comments/in Magento, Script, URL Rewrite /by puneetk00 hello this script for create your module rewrite URL, create script /* if(Mage::getModel(‘core/url_rewrite’)->loadByIdPath(“modulename/566”)){ echo Mage::getModel(‘core/url_rewrite’)->loadByIdPath(“modulename/56”)->getTargetPath(); } */ $shopurl = strtolower(preg_replace(‘/s+/’, ‘-‘, $this->getRequest()->getParam(‘shop_name’, false))); $useridshop = $model->getUserId(); // check shop url exist or not if(Mage::getModel(‘core/url_rewrite’)->loadByIdPath(“marketplace/”.$useridshop)){ $urlrewright = Mage::getModel(‘core/url_rewrite’)->loadByIdPath(“marketplace/”.$useridshop); }else{ $urlrewright = Mage::getModel(‘core/url_rewrite’); } // create or update shop url $urlrewright->setIsSystem(0) ->setStoreId(0) //->setOptions(‘RP’) ->setIdPath(‘marketplace/’.$useridshop) ->setTargetPath(‘modulename/index/index/’.$useridshop)// Put the actual path ->setRequestPath($shopurl.’.html’) // put the path you want to display ->save(); Puneet Kumar Magento Developer http://mg2dev.com/wp-content/uploads/2023/06/logo-transparent-png-300x86.png 0 0 puneetk00 http://mg2dev.com/wp-content/uploads/2023/06/logo-transparent-png-300x86.png puneetk002015-02-16 06:02:002015-02-16 06:02:00magento index rewright url create