i am using simple app with phalcon PHP and AngularJs. i am trying to call my phalcon PHP controller from angularJS controller through AJAX POST request.
$http.post('/ControllerName/', {params});
and i get
404 The requested URL /ControllerName/ was not found on this server
i think my request is being routed to my public folder whereas my php controller is located in Non-public folder.
these are the .htaccess rules i have
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]</IfModule>
and in the public folder:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]</IfModule>
what am i doing wrong?
Ok, My problem was in the rewrite mechanism as i thought. First, in httpd.conf file i had to:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With