Prescol Posted December 13, 2013 Share Posted December 13, 2013 Hi, i have created a custom module with MVC format. Im trying to get friendly urls but i get a 404 error. I explain: Actually URL is: www.myshop.com/en/module/mymodule/myfrontcontroller?param1=anything¶m2=something What i need is www.myshop.com/en/module/mymodule/myfrontcontroller/anything/something But i didn´t find where to add this functionality. Does anyone know? Thanks Link to comment Share on other sites More sharing options...
El Patron Posted December 13, 2013 Share Posted December 13, 2013 are you building the link in a .tpl file? Link to comment Share on other sites More sharing options...
Prescol Posted December 14, 2013 Author Share Posted December 14, 2013 are you building the link in a .tpl file? Hi El Patron. I´m creating the links in the module frontcontroller. They go in an array with other data. Then with a foreach loop are displayed in the view tpl. mymodulefolder | |_models | |_mymodel | |_controllers_ | | | |_defaultcontroller (here is where the links are created) | | | |_otherfrontcontroller | |_views |_defaultview Link to comment Share on other sites More sharing options...
El Patron Posted December 14, 2013 Share Posted December 14, 2013 www.myshop.com/en/module/mymodule/myfrontcontroller/anything/something if you take this approach the link will be followed to a 404, i.e /anything/something will be treated at part of the address so server will look in folder anything. in the .tpl are you using a form? if so then it would seem appropriate to use 'hidden' form valued for parm1 and parm2, this way they will not be seen in the url at all and can be read by your controller. Link to comment Share on other sites More sharing options...
Prescol Posted December 14, 2013 Author Share Posted December 14, 2013 www.myshop.com/en/module/mymodule/myfrontcontroller/anything/something if you take this approach the link will be followed to a 404, i.e /anything/something will be treated at part of the address so server will look in folder anything. in the .tpl are you using a form? if so then it would seem appropriate to use 'hidden' form valued for parm1 and parm2, this way they will not be seen in the url at all and can be read by your controller. I have forms, but i want to get friendly urls in order to get better SEO. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now