Magento – Calling Controller Path /foo/bar/baz Results in 404

404-pagecontrollersurlurl-rewrite

I have set up a simple custom controller based on Alan Storm's tutorial. My controller action should be available on this URL:

http://magento.localhost/helloworld/index/index/

But this path gives a Magento 404 error. The controller is instead found on the following path:

http://magento.localhost/index.php/default/helloworld/index/index/

I don't understand why is this happening, as all of the tutorials and articles I found on the net tell me, that this should be working like that, none of them mention any extra tinkering. This problem is the same for built-in controllers too. This is a base CE 1.7 installation with sample data.

Can anyone shed some light on the matter? Thanks!

Best Answer

Most probably you have "Show store codes in url" set to "Yes". This explains the need for "default" in the url.
If you cannot access your controller at http://magento.localhost/default/helloworld/index/index/ it means that your mod_rewrite is not enabled or is wrongly configured. This explains the need for index.php in the url.

Related Topic