Jump to content

Custom Module Controller is redirecting


Recommended Posts

Hi,

 

I have added a controller in module and when i tried to access that controller in front section then it shows something like that

 

Actual URL : http://stitchfit.localhost/index.php?fc=module&module=mdltestimonial&controller=add&id_lang=1

 

Message shows and page die..

 

[Debug] This page has moved
Please use the following URL instead: http://stitchfit.localhost/index.php?controller=add

 

I have tried to check that and found it in canonicalRedirection function in FrontController file, but how can i skip this one.

 

Link to comment
Share on other sites

  • 1 month later...

Same problem here...

 

Plus, i noticed something "funny" (hum hum) :

 

index.php?fc=module&module=mymodule&controller=mycontroller

I have the same message : Please use the following URL instead: (...)index.php?controller=mycontroller&module=mymodule

This url is on a 404

 

Same URL but parameters in a different order :

index.php?module=mymodule&controller=mycontroller&fc=module

It works...

Link to comment
Share on other sites

Solved !

I had this declaration in my controllers/front/mycontroller.php :

public $php_self = 'mycontroller';

 

I started my controller by copying one from the main /controller/front directory, and it seems in case of custom controllers this declaration isn't necessary.

  • Thanks 1
Link to comment
Share on other sites

×
×
  • Create New...