My controller name is Index and the action inside is Index and my route id and front name is evals so what to put in the url on javascript to get the right path of my controller. I put this type : "POST", url : '/evals/index', data: {'idRate':therate}, but as result i got an error: POST http://localhost/sajjada/evals/index/evals/index 404 (Not Found) can you please help me !!!


Your Url should be


Assume that http://localhost/sajjada is your magento base url

URL Format at magento2:


| improve this answer | |
  • but when i put my website on server it will change !! – Developper Magento Sep 17 '18 at 8:27
  • Onlky changes BASE URL like http://example.com/evals/index/index – Amit Bera Sep 17 '18 at 8:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.