[英]Magento custom module with custom url with add .html extension
我創建了一個模塊,其前端名稱為test。 現在我想要一個像
www.exmpale.com/test/red.html (original structure is like 'test/index/index/valuid/1/').
www.exmpale.com/test/green.html (original URL is like 'test/index/index/valueid/3/').
我的crontroller是indexCrontroller
而action是indexAction
,其中red / green從表開始動態變化。 表的結構就像
tab_id value
1 red
2 blue
3 green
請幫我。
您需要為這些URL實現路由器 。 請點擊此鏈接
http://inchoo.net/ecommerce/magento/custom-router-in-magento/
在htaccess文件中使用301重定向,如下所示:
將以下代碼粘貼到根文件夾的.htaccess文件中:
Redirect 301 /test/index/index/valuid/1/ www.exmpale.com/test/red.html
Redirect 301 /test/index/index/valuid/3/ www.exmpale.com/test/green.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.