Thinkphp5 domain name routing does not define array subscript 0

1. Config.php has set url_domain_deploy to true

2, the settings in route.php are as follows:

return [
    //,
    "__alias__"   => [
    ],
    //
    "__pattern__" => [
    ],
    //
    "__domain__"  => [
        "*.tt" => "index?subname=*",
    ],
];

as a result, the following error is reported. I don"t know what the problem is

Jul.15,2022

print step by step, in fact, such problems can be solved by yourself, without defining subscript, you can print $domains


250lines, breakpoint debugging method prints $rule, it is estimated that this is an array, but an associative array. Therefore, there is no subscript 0


you report an error because an url error is produced in your business logic, and the screenshot error code can only be called in the Url::build method. Fan domain name has bug. Do not use Fan domain name


add it to the common.php file in your program directory (at the bottom of this file)

error_reporting(E_ERROR | E_WARNING | E_PARSE);
Menu