2014-01-06 227 views
0

我已經創建了一個模塊,其前端名稱是測試。 現在,我要像Magento自定義模塊與自定義URL添加.html擴展

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/'). 

一個URL Wheremy crontroller是indexCrontroller和行動是indexAction何紅/綠,未來將動態從表中。 表結構就像

tab_id value 
1  red 

2  blue 
3  green 

請幫幫我。

回答

2

您需要實現路由器爲這些網址。請點擊此鏈接

http://inchoo.net/ecommerce/magento/custom-router-in-magento/ 
+0

謝謝您回覆。 –

2

使用301重定向htaccess的文件,如下所示:

下面的代碼在你的.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

+0

感謝您的答覆...但我不能用它......很多記錄將從分貝來了......我想功能,就如同目錄網址.... –