Jump to content

Avoid redirect for a module front controller


Recommended Posts

I am building an api for my PrestaShop module using a module FrontController.

class mymoduleModuleFrontController extends ModuleFrontController
{
    public function init()
    {
       echo "Hello world"; 
    }
}

The controller runs fine under mydomain.com/index.php?fc=module&module=mymodule&controller=api

However.. When I change shop domain to for example mynewdomain.com, PrestaShop automatically redirects me from mydomain.com/index.php?fc=module&module=mymodule&controller=api to mynewdomain.com/index.php?fc=module&module=mymodule&controller=api.

How can I disable automatic redirect for a PrestaShop ModuleFrontController?

I even tried to make it independent of the PrestaShop controller-system by accessing a PHP-file in my module-dir:

require_once(dirname(__FILE__).'/../../config/config.inc.php');
require_once('mymodule.php');

Even that last approach redirects me to the new domain.

Is there any way to disable PrestaShop redirects for a script?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...