迅睿CMS框架是一款PHP8高性能·简单易用的CMS开源开发框架,基于MIT开源许可协议发布,免费且不限制商业使用,是免费开源的产品,以万端互联为设计理念,支持的微信公众号、小程序、APP客户端、移动端网站、PC网站等多终端式管理系统。
联系官方销售客服
1835022288
028-61286886
独立模块伪静态 怎么设置不要模块名称 URL 不要模块名称 http://xxx.com/news/hangyezixun/1.html 变成 http://xxx.com/hangyezixun/1.html 这样 怎么做到啊
伪静态配置上传到附件中了
"([a-z0-9 \-\_]+)\/([0-9]+)" => "index.php?s=news&c=category&dir=$1&page=$2", //銆愮嫭绔嬫ā鍧椼€戞ā鍧楁爮鐩垪琛�(鍒嗛〉)锛坽modname}/{dirname}/{page}/锛� "([a-z0-9 \-\_]+)" => "index.php?s=news&c=category&dir=$1", //銆愮嫭绔嬫ā鍧椼€戞ā鍧楁爮鐩垪琛紙{modname}/{dirname}/锛� "([a-z0-9 \-\_]+)\/([0-9]+)-([0-9]+).html" => "index.php?s=news&c=show&id=$2&page=$3", //銆愮嫭绔嬫ā鍧椼€戞ā鍧楀唴瀹归〉(鍒嗛〉)锛坽modname}/{dirname}/{id}-{page}.html锛� "([a-z0-9 \-\_]+)\/([0-9]+).html" => "index.php?s=news&c=show&id=$2", //銆愮嫭绔嬫ā鍧椼€戞ā鍧楀唴瀹归〉锛坽modname}/{dirname}/{id}.html锛�
<?php /** * URL解析规则 * 例如: 114.html 对应 index.php?s=demo&c=show&id=114 * 可以解析: "114.html" => 'index.php?s=demo&c=show&id=114', * 动态id解析: "([0-9]+).html" => 'index.php?s=demo&c=show&id=$1', */ return [ /***********************下面写你自己的URL解析规则********************/ /***********************共享栏目测试规则:栏目列表页面分页的伪静态解析*************************/ "list\-([\w]+)\-([0-9]+).html(.*)" => 'index.php?c=category&dir=$1&page=$2', /***********************共享栏目测试规则:栏目列表页面的伪静态解析*************************/ "list\-([\w]+).html(.*)" => 'index.php?c=category&dir=$1', /***********************共享栏目测试规则:内容页面分页的伪静态解析*************************/ "show\-([0-9]+)\-([0-9]+).html(.*)" => 'index.php?c=show&id=$1&page=$2', /***********************共享栏目测试规则:内容页面的伪静态解析*************************/ "show\-([0-9]+).html(.*)" => 'index.php?c=show&id=$1', ////////////////////////////////////////////////////////////////////////////////////// /***********************共享模块测试规则:搜索页(带分页)*************************/ "([a-z]+)\/search\/(.*).html(.*)" => 'index.php?s=$1&c=search&rewrite=$2', /***********************共享模块测试规则:搜索页(不带分页)*************************/ "([a-z]+)\/search.html(.*)" => 'index.php?s=$1&c=search', ////////////////////////////////////////////////////////////////////////////////////// /***********************独立模块测试规则:模块首页的伪静态解析*************************/ //"([a-z]+).html(.*)" => 'index.php?s=$1', /***********************独立模块测试规则:栏目列表页面分页的伪静态解析*************************/ //"([a-z]+)\/list\/([0-9]+)\/([0-9]+).html(.*)" => 'index.php?s=$1&c=category&id=$2&page=$3', /***********************独立模块测试规则:栏目列表页面的伪静态解析*************************/ //"([a-z]+)\/list\/([0-9]+).html(.*)" => 'index.php?s=$1&c=category&id=$2', /***********************独立模块测试规则:内容页面分页的伪静态解析*************************/ //"([a-z]+)\/show\/([0-9]+)\/([0-9]+).html(.*)" => 'index.php?s=$1&c=show&id=$2&page=$3', /***********************独立模块测试规则:内容页面的伪静态解析*************************/ //"([a-z]+)\/show\/([0-9]+).html(.*)" => 'index.php?s=$1&c=show&id=$2', /***********************独立模块测试规则:模块首页的伪静态解析*************************/ "([a-z]+)" => 'index.php?s=$1', //【独立模块】模块首页({modname}/) /***********************共享模块测试规则:搜索页(带分页)*************************/ "([a-z]+)\/search\/(.+)" => 'index.php?s=$1&c=search&rewrite=$2', //【独立模块测试规则】模块搜索页(分页)({modname}/search/{param}/) /***********************共享模块测试规则:搜索页(不带分页)*************************/ "([a-z]+)\/search" => 'index.php?s=$1&c=search', //【独立模块测试规则】模块搜索页({modname}/search/) /***********************独立模块测试规则:栏目列表页面分页的伪静态解析*************************/ "([a-z0-9 \-\_]+)\/([0-9]+)" => 'index.php?s=purchase&c=category&dir=$1&page=$2', //【采购大厅】模块栏目列表(分页)({modname}/{dirname}/{page}/) "([a-z0-9 \-\_]+)\/([0-9]+)" => 'index.php?s=info&c=category&dir=$1&page=$2', //【供应大厅】模块栏目列表(分页)({modname}/{dirname}/{page}/) "([a-z0-9 \-\_]+)\/([0-9]+)" => 'index.php?s=company&c=category&dir=$1&page=$2', //【企业黄页】模块栏目列表(分页)({modname}/{dirname}/{page}/) "([a-z0-9 \-\_]+)\/([0-9]+)" => 'index.php?s=news&c=category&dir=$1&page=$2', //【资讯中心】模块栏目列表(分页)({modname}/{dirname}/{page}/) "([a-z0-9 \-\_]+)\/([0-9]+)" => 'index.php?s=ask&c=category&dir=$1&page=$2', //【知识问答】模块栏目列表(分页)({modname}/{dirname}/{page}/) "([a-z0-9 \-\_]+)\/([0-9]+)" => 'index.php?s=baike&c=category&dir=$1&page=$2', //【行业百科】模块栏目列表(分页)({modname}/{dirname}/{page}/) /***********************独立模块测试规则:栏目列表页面的伪静态解析*************************/ "([a-z0-9 \-\_]+)" => 'index.php?s=purchase&c=category&dir=$1', //【采购大厅】模块栏目列表({modname}/{dirname}/) "([a-z0-9 \-\_]+)" => 'index.php?s=info&c=category&dir=$1', //【供应大厅】模块栏目列表({modname}/{dirname}/) "([a-z0-9 \-\_]+)" => 'index.php?s=company&c=category&dir=$1', //【企业黄页】模块栏目列表({modname}/{dirname}/) "([a-z0-9 \-\_]+)" => 'index.php?s=news&c=category&dir=$1', //【资讯中心】模块栏目列表({modname}/{dirname}/) "([a-z0-9 \-\_]+)" => 'index.php?s=ask&c=category&dir=$1', //【知识问答】模块栏目列表({modname}/{dirname}/) "([a-z0-9 \-\_]+)" => 'index.php?s=baike&c=category&dir=$1', //【行业百科】模块栏目列表({modname}/{dirname}/) /***********************独立模块测试规则:内容页面分页的伪静态解析*************************/ "([a-z0-9 \-\_]+)\/([0-9]+)-([0-9]+).html" => 'index.php?s=purchase&c=show&id=$2&page=$3', //【采购大厅】模块内容页(分页)({modname}/{dirname}/{id}-{page}.html) "([a-z0-9 \-\_]+)\/([0-9]+)-([0-9]+).html" => 'index.php?s=info&c=show&id=$2&page=$3', //【供应大厅】模块内容页(分页)({modname}/{dirname}/{id}-{page}.html) "([a-z0-9 \-\_]+)\/([0-9]+)-([0-9]+).html" => 'index.php?s=company&c=show&id=$2&page=$3', //【企业黄页】模块内容页(分页)({modname}/{dirname}/{id}-{page}.html) "([a-z0-9 \-\_]+)\/([0-9]+)-([0-9]+).html" => 'index.php?s=news&c=show&id=$2&page=$3', //【资讯中心】模块内容页(分页)({modname}/{dirname}/{id}-{page}.html) "([a-z0-9 \-\_]+)\/([0-9]+)-([0-9]+).html" => 'index.php?s=ask&c=show&id=$2&page=$3', //【知识问答】模块内容页(分页)({modname}/{dirname}/{id}-{page}.html) "([a-z0-9 \-\_]+)\/([0-9]+)-([0-9]+).html" => 'index.php?s=baike&c=show&id=$2&page=$3', //【行业百科】模块内容页(分页)({modname}/{dirname}/{id}-{page}.html) /***********************独立模块测试规则:内容页面的伪静态解析*************************/ "([a-z0-9 \-\_]+)\/([0-9]+).html" => 'index.php?s=purchase&c=show&id=$2', //【采购大厅】模块内容页({modname}/{dirname}/{id}.html) "([a-z0-9 \-\_]+)\/([0-9]+).html" => 'index.php?s=info&c=show&id=$2', //【供应大厅】模块内容页({modname}/{dirname}/{id}.html) "([a-z0-9 \-\_]+)\/([0-9]+).html" => 'index.php?s=company&c=show&id=$2', //【企业黄页】模块内容页({modname}/{dirname}/{id}.html) "([a-z0-9 \-\_]+)\/([0-9]+).html" => 'index.php?s=news&c=show&id=$2', //【资讯中心】模块内容页({modname}/{dirname}/{id}.html) "([a-z0-9 \-\_]+)\/([0-9]+).html" => 'index.php?s=ask&c=show&id=$2', //【知识问答】模块内容页({modname}/{dirname}/{id}.html) "([a-z0-9 \-\_]+)\/([0-9]+).html" => 'index.php?s=baike&c=show&id=$2', //【行业百科】模块内容页({modname}/{dirname}/{id}.html) ];
<?php /** * URL解析规则 * 例如: 114.html 对应 index.php?s=demo&c=show&id=114 * 可以解析: "114.html" => 'index.php?s=demo&c=show&id=114', * 动态id解析: "([0-9]+).html" => 'index.php?s=demo&c=show&id=$1', */ return [ /***********************下面写你自己的URL解析规则********************/ /***********************共享栏目测试规则:栏目列表页面分页的伪静态解析*************************/ "list\-([\w]+)\-([0-9]+).html(.*)" => 'index.php?c=category&dir=$1&page=$2', /***********************共享栏目测试规则:栏目列表页面的伪静态解析*************************/ "list\-([\w]+).html(.*)" => 'index.php?c=category&dir=$1', /***********************共享栏目测试规则:内容页面分页的伪静态解析*************************/ "show\-([0-9]+)\-([0-9]+).html(.*)" => 'index.php?c=show&id=$1&page=$2', /***********************共享栏目测试规则:内容页面的伪静态解析*************************/ "show\-([0-9]+).html(.*)" => 'index.php?c=show&id=$1', ////////////////////////////////////////////////////////////////////////////////////// /***********************共享模块测试规则:搜索页(带分页)*************************/ "([a-z]+)\/search\/(.*).html(.*)" => 'index.php?s=$1&c=search&rewrite=$2', /***********************共享模块测试规则:搜索页(不带分页)*************************/ "([a-z]+)\/search.html(.*)" => 'index.php?s=$1&c=search', ////////////////////////////////////////////////////////////////////////////////////// /***********************独立模块测试规则:模块首页的伪静态解析*************************/ //"([a-z]+).html(.*)" => 'index.php?s=$1', /***********************独立模块测试规则:栏目列表页面分页的伪静态解析*************************/ //"([a-z]+)\/list\/([0-9]+)\/([0-9]+).html(.*)" => 'index.php?s=$1&c=category&id=$2&page=$3', /***********************独立模块测试规则:栏目列表页面的伪静态解析*************************/ //"([a-z]+)\/list\/([0-9]+).html(.*)" => 'index.php?s=$1&c=category&id=$2', /***********************独立模块测试规则:内容页面分页的伪静态解析*************************/ //"([a-z]+)\/show\/([0-9]+)\/([0-9]+).html(.*)" => 'index.php?s=$1&c=show&id=$2&page=$3', /***********************独立模块测试规则:内容页面的伪静态解析*************************/ //"([a-z]+)\/show\/([0-9]+).html(.*)" => 'index.php?s=$1&c=show&id=$2', /***********************独立模块测试规则:模块首页的伪静态解析*************************/ "([a-z]+)" => 'index.php?s=$1', /***********************共享模块测试规则:搜索页(带分页)*************************/ "([a-z]+)\/search\/(.+)" => 'index.php?s=$1&c=search&rewrite=$2', /***********************共享模块测试规则:搜索页(不带分页)*************************/ "([a-z]+)\/search" => 'index.php?s=$1&c=search', /***********************独立模块测试规则:栏目列表页面分页的伪静态解析*************************/ "([a-z0-9 \-\_]+)\/([0-9]+)" => 'index.php?s=purchase&c=category&dir=$1&page=$2', "([a-z0-9 \-\_]+)\/([0-9]+)" => 'index.php?s=info&c=category&dir=$1&page=$2', "([a-z0-9 \-\_]+)\/([0-9]+)" => 'index.php?s=company&c=category&dir=$1&page=$2', "([a-z0-9 \-\_]+)\/([0-9]+)" => 'index.php?s=news&c=category&dir=$1&page=$2', "([a-z0-9 \-\_]+)\/([0-9]+)" => 'index.php?s=ask&c=category&dir=$1&page=$2', "([a-z0-9 \-\_]+)\/([0-9]+)" => 'index.php?s=baike&c=category&dir=$1&page=$2', /***********************独立模块测试规则:栏目列表页面的伪静态解析*************************/ "([a-z0-9 \-\_]+)" => 'index.php?s=purchase&c=category&dir=$1', "([a-z0-9 \-\_]+)" => 'index.php?s=info&c=category&dir=$1', "([a-z0-9 \-\_]+)" => 'index.php?s=company&c=category&dir=$1', "([a-z0-9 \-\_]+)" => 'index.php?s=news&c=category&dir=$1', "([a-z0-9 \-\_]+)" => 'index.php?s=ask&c=category&dir=$1', "([a-z0-9 \-\_]+)" => 'index.php?s=baike&c=category&dir=$1', /***********************独立模块测试规则:内容页面分页的伪静态解析*************************/ "([a-z0-9 \-\_]+)\/([0-9]+)-([0-9]+).html" => 'index.php?s=purchase&c=show&id=$1&page=$2', "([a-z0-9 \-\_]+)\/([0-9]+)-([0-9]+).html" => 'index.php?s=info&c=show&id=$1&page=$2', "([a-z0-9 \-\_]+)\/([0-9]+)-([0-9]+).html" => 'index.php?s=company&c=show&id=$1&page=$2', "([a-z0-9 \-\_]+)\/([0-9]+)-([0-9]+).html" => 'index.php?s=news&c=show&id=$1&page=$2', "([a-z0-9 \-\_]+)\/([0-9]+)-([0-9]+).html" => 'index.php?s=ask&c=show&id=$1&page=$2', "([a-z0-9 \-\_]+)\/([0-9]+)-([0-9]+).html" => 'index.php?s=baike&c=show&id=$1&page=$2', /***********************独立模块测试规则:内容页面的伪静态解析*************************/ "([a-z0-9 \-\_]+)\/([0-9]+).html" => 'index.php?s=purchase&c=show&id=$1', "([a-z0-9 \-\_]+)\/([0-9]+).html" => 'index.php?s=info&c=show&id=$1', "([a-z0-9 \-\_]+)\/([0-9]+).html" => 'index.php?s=company&c=show&id=$1', "([a-z0-9 \-\_]+)\/([0-9]+).html" => 'index.php?s=news&c=show&id=$1', "([a-z0-9 \-\_]+)\/([0-9]+).html" => 'index.php?s=ask&c=show&id=$1', "([a-z0-9 \-\_]+)\/([0-9]+).html" => 'index.php?s=baike&c=show&id=$1', ];
"p\/([a-z0-9 \-\_]+)\/([0-9]+).html" => "index.php?s=purchase&c=show&id=$2", //【采购大厅】模块内容页({modname}/{dirname}/{id}.html)
"i\/([a-z0-9 \-\_]+)\/([0-9]+).html" => "index.php?s=info&c=show&id=$2", //【供应大厅】模块内容页({modname}/{dirname}/{id}.html)
"c\/([a-z0-9 \-\_]+)\/([0-9]+).html" => "index.php?s=company&c=show&id=$2", //【企业黄页】模块内容页({modname}/{dirname}/{id}.html)
"n\/([a-z0-9 \-\_]+)\/([0-9]+).html" => "index.php?s=news&c=show&id=$2", //【资讯中心】模块内容页({modname}/{dirname}/{id}.html)
"a\/([a-z0-9 \-\_]+)\/([0-9]+).html" => "index.php?s=ask&c=show&id=$2", //【知识问答】模块内容页({modname}/{dirname}/{id}.html)
"b\/([a-z0-9 \-\_]+)\/([0-9]+).html" => "index.php?s=baike&c=show&id=$2", //【行业百科】模块内容页({modname}/{dirname}/{id}.html)你加一个前缀久可以识别了,总之前面部分不能相同重复
把这个去掉就行,然后 打开文件config/rewrite.php文件,里面 的解析代码需要修改
伪静态配置上传到附件中了
数组的意思是,前面参数不能相同,只能识别一个----------也就是太多无用的了
"p\/([a-z0-9 \-\_]+)\/([0-9]+).html" => "index.php?s=purchase&c=show&id=$2", //【采购大厅】模块内容页({modname}/{dirname}/{id}.html)
"i\/([a-z0-9 \-\_]+)\/([0-9]+).html" => "index.php?s=info&c=show&id=$2", //【供应大厅】模块内容页({modname}/{dirname}/{id}.html)
"c\/([a-z0-9 \-\_]+)\/([0-9]+).html" => "index.php?s=company&c=show&id=$2", //【企业黄页】模块内容页({modname}/{dirname}/{id}.html)
"n\/([a-z0-9 \-\_]+)\/([0-9]+).html" => "index.php?s=news&c=show&id=$2", //【资讯中心】模块内容页({modname}/{dirname}/{id}.html)
"a\/([a-z0-9 \-\_]+)\/([0-9]+).html" => "index.php?s=ask&c=show&id=$2", //【知识问答】模块内容页({modname}/{dirname}/{id}.html)
"b\/([a-z0-9 \-\_]+)\/([0-9]+).html" => "index.php?s=baike&c=show&id=$2", //【行业百科】模块内容页({modname}/{dirname}/{id}.html)你加一个前缀久可以识别了,总之前面部分不能相同重复