路由功能失效

浏览:361 发布日期:2018/11/22 分类:ThinkPHP5专区 关键字: TP5 路由
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

\think\Route::rule('wsy','/public/index.php/index/news/index');
return [
    '__pattern__' => [
        'name' => '\w+',
    ],
    '[hello]'     => [
        ':id'   => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
        ':name' => ['index/hello', ['method' => 'post']],
    ],

];
设置了上述路由
然后通过XXX.com/wsy 访问到的是主页

然后在不修改路由的情况下,无论XXX.com/ 后面跟的是什么。都会跳转到主页。求解。。
类似下图,无论后面跟的是什么都是进主页
最佳答案
评论( 相关
后面还有条评论,点击查看>>