在URL美化里。删除所有的规则后,只添加2条。确实是可以把cms改成news,或者其它的名称。 可以这样访问,xxx.com/news/
但是添加通用的内容页规则后。会自动加上index.html,那就是隐藏index.html这个没起作用了。怎么处理呢 ? 访问xxx.com/news/会跳到xxx.com/news/index.html
如果只是把cms改成news直接在application目录下创建routemy.php
代码如下需要什么形式自己调整即可
<?php use think\Route; Route::group(['name'=>'','ext'=>'html'], [ 'news/<id>' =>['cms/content/show',['method'=>'get'],['id' => '\d+']], 'news/list-<fid>'=>['cms/content/index',['method'=>'get'],['fid' => '\d+']], 'news/mid-<mid>'=>['cms/content/index',['method'=>'get'],['mid' => '\d+']], 'news/<id>' => 'cms/content/show', 'news/list' => 'cms/content/index', 'news$' => 'cms/index/index', ]);