I write a controller in CakePhp-2.9 named API to access outside. Controller Code:
class APIController extends AppController
{
var $name = 'API';
var $cache_dir = 'img/cache';
var $cache_width = 400;
public $msgs = array();
public function beforeFilter()
{
parent::beforeFilter();
$this->Auth->allow('ecall_request','ecall_callback','testlog','ecall_request_test','ecall_callback_test');
}
public function ecall_request()
{
Cache::write("test_request".time(),$this->request->data);
if($this->request->is('post'))
{
// my code here
}
}
}
And i tested "http://localhost/dentech/api/ecall_request" on POSTMAN successfully, But when i upload it on server at https://dentech.com/api/ecall_request it does not access and gives 404 error.
htaccess code is:
<IfModule mod_rewrite.c>
RewriteEngine on
# Uncomment if you have a .well-known directory in the root folder, e.g. for the Let's Encrypt challenge
# https://tools.ietf.org/html/rfc5785
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#RewriteRule ^(\.well-known/.*)$ $1 [L]
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]