404 error when calling REST api (Phalcon)

Standard

XMLHttpRequest cannot load http://ajax.example.com/like/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://blog.example.com' is therefore not allowed access.

Solution:

Set htaccess like this:

# Always set these headers.
Header always setAccess-Control-Allow-Origin"*"
Header always setAccess-Control-Allow-Methods"POST, GET, OPTIONS, DELETE, PUT"
Header always setAccess-Control-Max-Age"1000"
Header always setAccess-Control-Allow-Headers"x-requested-with, Content-Type, origin, authorization, accept, client-security-token"