啥也不说,上代码:
route.php
Route::domain('admin', function () {
Route::rule('/', 'Index/index')->https();
Route::rule(':action', 'admin/Index/:action')->https()->ext('html');
})->bind('admin');
我想要让二级域名admin访问admin模块,Index控制器。
例如 https://admin.域名/a.html
实际访问 https://admin.域名/admin/index/a
经过测试,路由规则没错,能正确访问。
但 echo url('admin/index/a');
打印结果 /index/a.html
路由不匹配。
我现在需要怎么改?
最佳答案