Jump to content

Friendly URLs with params in modules frontcontroller


Prescol

Recommended Posts

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&param2=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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...