Magento custom module with custom url with add .html extension

做~自己de王妃 提交于 2019-12-13 06:14:13

问题


I have created an module and its front end name is test . Now i want a URL like

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

Wheremy crontroller is indexCrontroller and action is indexAction and where red /green ,will coming dynamic from a table. The Table is structure is like

 tab_id  value
 1      red

 2      blue
 3      green

Please help me.


回答1:


You need to implement the Router for these URLs. please follow this link

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




回答2:


Use 301 redirect in htaccess file as follows:

Paste the below code in your .htaccess file in root folder:

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



来源:https://stackoverflow.com/questions/20952021/magento-custom-module-with-custom-url-with-add-html-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!