Skip to content

Bug: Inconsistent hostname/subdomain limitation in Routing #7214

Description

@kenjis

CodeIgniter version: 4.3.1

(1) hostname takes precedence over subdomain
if a route has both:

$routes->get('/', 'Home::index');
$routes->get('/', 'Media::index', ['hostname' => 'media.example.com:8888', 'subdomain' => '*']);

http://media.example.com:8888/ci431/public/ → App\Controllers\Media::index
http://user.example.com:8888/ci431/public/ → App\Controllers\Home::index

(2) subdomain takes precedence over hostname
if two routes matches:

$routes->get('/', 'Home::index');
$routes->get('/', 'Media::index', ['hostname' => 'media.example.com:8888']);
$routes->get('/', 'All::index', ['subdomain' => '*']);

http://media.example.com:8888/ci431/public/ → App\Controllers\All::index
http://user.example.com:8888/ci431/public/ → App\Controllers\All::index

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

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions