投稿 评论 顶部

Thinkphp里面设置url伪静态

佚名 网络安全
return [    //别名配置,别名只能是映射到控制器且访问时必须加上请求的方法    '__alias__'   => [        'cms'   => 'admin/index/login',        'news'  => 'index/news/index',        //'new/:id' => 'index/news/read?id=:id',    ],    '[new]'     => [        ':id'   => ['index/news/read', ['method' => 'get'], ['id' => '\d+']],        ':title' => ['index/news/read', ['method' => 'post'],['title' => '\w+']],    ],    //'new/:id' => '/index.php/index/news/read?id=:id',    //变量规则    '__pattern__' => [        //'/^new\/(\d+)$/' => '/index.php/index/news/read?id=$1',    ],//        域名绑定到模块//        '__domain__'  => [//            'admin' => 'admin',//            'api'   => 'api',//        ],];
thinkphp伪静态示例。