I've created a module that has frontend page. I want to pass parameters to that page. When i enter http://mydomain.com/news - it shows me my page but when i cal http://mydomain.com/news/id/1 - it shows 404 error page.
1 Answer
If your module uses the default routing system of magento {module}/{controller}/{action}
, it doesn't work in your case because Magento is looking for the class named IdController
and the method 1Action
(this can not even exist).
if the controller name and/or action name are missing Magento uses index
for them.
And since the url /news/
works, I assume it is handled by the indexAction
from the IndexController
.
If you want to pass parameters you have 2 options:
Option 1
Pass them as simple GET
parameters: /news/?id=1
.
Option 2
Use the full action url: /news/index/index/id/1
.