怎么把网址默认的cms改成news或其他?
application/目录下,新建一个
routemy.php 内容
<?php use think\Route; Route::group(['name'=>'你想要的news','ext'=>'html'], [ 'show-<id>$' =>['cms/content/show',['method'=>'get'],['id' => '\d+']], 'list-<fid>'=>['cms/content/index',['method'=>'get'],['fid' => '\d+']], 'mid-<mid>$'=>['cms/content/index',['method'=>'get'],['mid' => '\d+']], 'show' => 'cms/content/show', 'list' => 'cms/content/index', 'index' => 'cms/index/index', ]);
这里的 会优先 route.php中的规则。
route.php会被升级,但 routemy.php这个文件以后不会被升级(用于自定义的)
求方法