I am developing a new module for my company in **Magento 2** and i require an AJAX Http post request, however I cannot find the correct URL.

I have all of my controllers currently set up however, when I send the request in JQuery I receive a 404 error.

File structure:








For example, if i am trying to send a request to Post/Message.php, What would the correct URL be?


  • are you working for magento-1 or magento 2? Commented Jan 16, 2018 at 9:21
  • Magento 2, sorry I will update it now
    – user61783
    Commented Jan 16, 2018 at 9:29
  • I post the answer, please check Commented Jan 16, 2018 at 9:37

1 Answer 1


Here are the correct path of your above things.

  1. Magento_domain/extension_frontend_router/post/message

  2. Magento_domain/extension_frontend_router/post/user

  3. Magento_domain/extension_frontend_router/get/threads

  4. Magento_domain/extension_frontend_router/get/messages

  • hi Dhiren, In my frontend/routes.xml file, the front name is "forum". does this mean that the url i want to hit is www.mywebsite.com/forum/post/message? because this is the one showing a 404
    – user61783
    Commented Jan 16, 2018 at 9:43
  • yes "www.mywebsite.com/forum/post/message" right URL if everything implement properly. Commented Jan 16, 2018 at 9:46
  • 1
    If my answer help you, please accept so it will help other in community. Commented Jan 16, 2018 at 10:04
  • this does not seem to be working for me, I have been testing it for a while and cannot make it work
    – user61783
    Commented Jan 16, 2018 at 11:51
  • First check have implement all the things proper? Commented Jan 16, 2018 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.