汇总常见的伪静态规则

2024-01-26 14:01 小编

示例URL规则导入代码方法:

{xunruicms_img_title}


解析规则config/rewrite.php代码设置方法:(需要删除原有的解析规则内容)

{xunruicms_img_title}

---------------------------示例----------------------

目录模式AA/BB/

栏目页:/aaa/bbb
栏目分页:/aaa/bbb/p88.html
内容页:/aaa/bbb/11.html
内容分页:无

{xunruicms_img_title}

导入代码:

{"id":"6","type":"3","name":"目录模式AA\/BB\/","value":"{\"list\":\"{pdirname}\",\"list_page\":\"{pdirname}\\\/p{page}.html\",\"show\":\"{pdirname}\\\/{id}.html\",\"show_page\":\"\",\"catjoin\":\"\\\/\"}"}

解析规则config/rewrite.php代码:

   "([\w\/]+)\/p([0-9]+)\.html" => "index.php?c=category&dir=$1&page=$2",  //【目录模式AA/BB/】模块栏目列表(分页)({pdirname}/p{page}.html)

   "([\w\/]+)\/([0-9]+)\.html" => "index.php?c=show&id=$2",  //【目录模式AA/BB/】模块内容页({pdirname}/{id}.html)

   "([\w\/]+)" => "index.php?c=category&dir=$1",  //【目录模式AA/BB/】模块栏目列表({pdirname})

文件模式AA.html

栏目页:/aa.html
栏目分页:/aa-p88.html
内容页:/aa-11.html
内容分页:无

{xunruicms_img_title}

导入代码:

{"id":"8","type":"3","name":"文件模式AA.html","value":"{\"list\":\"{dirname}.html\",\"list_page\":\"{dirname}-p{page}.html\",\"show\":\"{dirname}-{id}.html\",\"show_page\":\"\",\"catjoin\":\"\\\/\"}"}

解析规则config/rewrite.php代码:

  "([A-za-z0-9 \-\_]+)-p([0-9]+)\.html" => "index.php?c=category&dir=$1&page=$2",  //【文件模式AA.html】模块栏目列表(分页)({dirname}-p{page}.html)

    "([A-za-z0-9 \-\_]+)-([0-9]+)\.html" => "index.php?c=show&id=$2",  //【文件模式AA.html】模块内容页({dirname}-{id}.html)

    "([A-za-z0-9 \-\_]+)\.html" => "index.php?c=category&dir=$1",  //【文件模式AA.html】模块栏目列表({dirname}.html)

目录模式AA/

栏目页:/aa/
栏目分页:/aa/p88.html
内容页:/aa/11.html
内容分页:无

{xunruicms_img_title}

导入代码:

{"id":"9","type":"3","name":"目录模式AA","value":"{\"list\":\"{dirname}\",\"list_page\":\"{dirname}\\\/p{page}.html\",\"show\":\"{dirname}\\\/{id}.html\",\"show_page\":\"\",\"catjoin\":\"\\\/\"}"}

解析规则config/rewrite.php代码:

    "([A-za-z0-9 \-\_]+)\/p([0-9]+)\.html" => "index.php?c=category&dir=$1&page=$2",  //【文件模式AA.html】模块栏目列表(分页)({dirname}/p{page}.html)

    "([A-za-z0-9 \-\_]+)\/([0-9]+)\.html" => "index.php?c=show&id=$2",  //【文件模式AA.html】模块内容页({dirname}/{id}.html)

    "([A-za-z0-9 \-\_]+)" => "index.php?c=category&dir=$1",  //【文件模式AA.html】模块栏目列表({dirname}/)

目录/年月日id。

栏目页:无

栏目分页:无

内容页:{dirname}/{y}{m}{d}{id}.html

内容分页:无

解析规则config/rewrite.php代码:

<div><br class="Apple-interchange-newline"> "([A-za-z0-9 \-\_]+)\/([0-9]{8})([0-9]+)\.html" => "index.php?c=show&id=$3",  //{dirname}/{y}{m}{d}{id}.html</div>




在线咨询 拨打电话

电话

13363039260

内部绝密传真282期

微信二维码