Skip to content

Router issue - overwriting. #1692

Description

@nowackipawel

I've got two subdomains:
doc and dev.
And my Routes.php is as bellow:

$routes->setDefaultNamespace('App\Controllers');
$routes->setDefaultController('Home');
$routes->setDefaultMethod('index');
...
$routes->get('/', 	'App\Controllers\Site\CDoc::index', ['subdomain' => 'doc', 'as' => 'doc_index']);
$routes->add('/', 'Home::index');

but after request to https://doc.domain I get Home::index instead of App\Controllers\Site\CDoc::index
I thought the first which is matched is used.... but nope.
I did a test and I changed it to:

$routes->add('/', 'Home::index');  // get is working in the same way
$routes->get('/', 	'App\Controllers\Site\CDoc::index', ['subdomain' => 'doc', 'as' => 'doc_index']);

effect still the same - doc.domain is opening Home::index .

OFC everything is working as excepted if dev.domain route to Home::index is defined like that : $routes->add('/', 'Home::index', ['subdomain' => 'dev']);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions