We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Multi-module routing not working

I've created an application based on template "modules" with phalcon-devtools. I have two modules registered : "home" and "test", in my "home --> index controller" i redirect to the index controller in test. Redirection is not working. I have the preconfigured files config/services.php, config/routes.php and config/modules.php i didn't touch any of this. to redirect i use $this->response->redirect('test/index');

my baseUri is set to "/" because my server localhost is already in project folder.



3.5k
Accepted
answer

Hi!

Without code to find error complicated. I create simple worked demo for you. Demo has two modules with redirect from home module to test module. See link below. I did make minimum change in code.

Using Phalcon 2.0.11 PHP 5.6

Source code

edited May '16

Thank you very much ! and thank you for the fast answer !

My problems cames from the .htaccess files (The one in / and the one in /public/ ).

I should have looked again at https://docs.phalcon.io/en/latest/reference/apache.html but i think i had change these files because i'm working with Polymer too and sometimes redirections and automatic process are difficult to manage with Phalcon.

because i'm working with Polymer

You create onepagesite? with phalcon as backend and using routing from Polymer for navigate?

No, i'm not using Polymer for routing. I'm migrating an existing Polymer project to Phalcon php. It was a project to learn Polymer but became a real one and impossible to maintain without a good php framework, so i'm now using Phalcon to continue (or restart) this project. The point is to use ony Polymer for Webcomponents et the material design. Phalcon php will take care of everything else. It was onepagesite but it will change a little.