OpenMage / magento-lts

Official OpenMage LTS codebase | Migrate easily from Magento Community Edition in minutes! Download the source code for free or contribute to OpenMage LTS | Security vulnerability patches, bug fixes, performance improvements and more.
https://www.openmage.org
Open Software License 3.0
870 stars 436 forks source link

Certain routes behaviour for 404 links #69

Closed moraryou closed 8 years ago

moraryou commented 8 years ago

Router does not redirect to 404 for certain frontend routes, example: http://demo.icebergcommerce.com/contacts/index/index/index/this-should-redirect-to-404 For the contacts route for example if you add: /index/index/index/this-should-redirect-to-404 this should result in 404 as the route does not exists, but still it serves the contacts route.

drobinson commented 8 years ago

Since Magento's default routing algorithm uses three part URLs, I think this would be considered a feature (implement different routing algorithm) which is outside the scope of this repository.

In your example, the indexAction method of the index controller for the contacts route is invoked, and the final 'index/this-should-redirect-to-404' is parsed into parameters as a key=>value pair. This functionality is used throughout the system, so I don't think we could easily check for "existing" routes without significant changes. Unless you have another suggestion?

moraryou commented 8 years ago

I understand that the last segments are parsed into params key=>value pair. I am learning Magento and though the routing process to be a bit weird since it allows for cases like this. Since this is out of the scope of this repository we can close this.

And i actually came here trying to understand how i could create a route of this format: a/b/c/d/e/f where e is the controller and f is the action.

drobinson commented 8 years ago

This module should help with that: https://github.com/OpenMage/OpenMage_Routers

moraryou commented 8 years ago

Thank you so much, now it is all clear.