My prestashop module has couple of moduleFrontControllers and everything seems to work fine, but:
PrestaShop >= v1.6.1.20 (PHP >= 5.6.37) on my local dev_platform and on production test platform - everything works fine. Couple of clients use it without any problems too. (example front controller url https://myprestashop/modulename/token - 200response)
PrestaShop <= v1.6.1.1 (PHP <= 5.5.38), friendly URL's turned on, mod_rewrite ON - module just won't work. (example url same as above but 404-not found response and it's the same for all my moduleFrontControllers)
Any idea what could cause the problem here? Is it PrestaShop version or maybe PHP version fault? Are there other requirements in older PrestaShops maybe? I'm out of guesses here.
example of my moduleFrontController:
class ModulenameTokenModuleFrontController extends AbstractRestController
{
protected function processGetRequest()
{
try {
//some_code
$this->ajaxDie(json_encode($result));
} catch (Exception $e) {
$this->ajaxDie(json_decode($e->getMessage()));
}
}
protected function processPostRequest()
{
}
protected function processPutRequest()
{
}
protected function processDeleteRequest()
{
}
}
and
abstract class AbstractRestController extends ModuleFrontController
{
public function init()
{
parent::init();
switch ($_SERVER['REQUEST_METHOD']) {
case 'GET':
$this->processGetRequest();
break;
case 'POST':
$this->processPostRequest();
break;
case 'PATCH':
case 'PUT':
$this->processPutRequest();
break;
case 'DELETE':
$this->processDeleteRequest();
break;
default:
}
}
abstract protected function processGetRequest();
abstract protected function processPostRequest();
abstract protected function processPutRequest();
abstract protected function processDeleteRequest();
}