Calling controller path /foo/bar/baz results in 404, but is found at default/index.php/foo/bar/baz

magento.stackexchange https://magento.stackexchange.com/questions/10150

문제

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!

도움이 되었습니까?

해결책

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.

다른 팁

I am on magento 1.8 and i fixed my 404 error by doing the following. inside Magentotutorial_Helloworld.xml they tell you to put this code in

"codePool local codePool"

since i do not have a local folder i put mine into the community folder. Change the code to this and it will work.

"codePool community codePool"

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top