magento如何重写自定义mdoule URL

magento如何重写自定义mdoule URL,magento,url-rewriting,custom-url,Magento,Url Rewriting,Custom Url,我已经为不同国家/地区和城市的商店创建了自定义模块,因此我必须重写模块的url 从此url到 此url 下面是我的URLEwrite代码 <?php $storeId = Mage::app()->getStore()->getId(); Mage::getModel('core/url_rewrite') ->setIsSystem(0) ->setStoreId($storeId)

我已经为不同国家/地区和城市的商店创建了自定义模块,因此我必须重写模块的url 从此url到 此url
下面是我的URLEwrite代码

<?php 

        $storeId = Mage::app()->getStore()->getId();
        Mage::getModel('core/url_rewrite')
        ->setIsSystem(0)
        ->setStoreId($storeId)   
        ->setOptions('RP')  
        ->setIdPath('viewcountry/country/' .$country['value'])
        ->setTargetPath($country['label'].'-sarees-shops.html')
        ->setRequestPath('shops/index/viewcountry/country/'.$country['value'].'/')
        ->save(); 
?>

同时获取“指定存储的ID路径,指定存储的请求路径已存在”错误请帮助我尝试以下操作:

->setIdPath('viewcountry/country/'.$country['value'].'_'.time())

这会随机化
id\u路径
,它仍然会从
requested\u路径
重定向到
target\u路径

我正在获取指定存储的错误id路径,指定存储的请求路径已经存在,并且重定向正在工作,但目标的请求路径为404 eror,因此请建议我。。。提前感谢这意味着您已经对该请求路径进行了重写。在重写管理网格中搜索
请求路径中的
并将其删除。是的,我也删除了,但得到了错误。你能建议我用其他方法重写magento中的URL吗?