在application文件下找到route.php在里面配置路由
use think\Route; Route::rule('hello','samiple/test/hello');http://z.cn:8080/hello访问方式即可访问,就像hello代理了 samiple/test/hello这个路径
路由的各种配置
//Route::rule('hello','samiple/test/hello','GET|POST',['https'=>false]);//代表即使是get还是post都能访问成功 Route::get('hello','samiple/test/hello'); //Route::any('hello','samiple/test/hello'); //代表所有的*号,即什么访问都能允许通过 //Route::post('hello','samiple/test/hello');
Route::rule('路由表达式','路由地址','请求类型','路由参数[数组的形式]','变量规则[数组的形式]');