admin 发表于 2020-9-15 23:35:20

destoon详情页url根目录化以模块目录名区分

详情页url根目录化,为了不冲突,教程就以模块目录名去分辨网址原网址 www.***.com/sell/show-100.html改变后形成的最终效果为 www.***.com/sell-100.html
规则注解其中:sell为自动识别模块目录名-为分割线100为信息id值
开发方法如下:1、找到总函数文件 include/global.func.php
搜索$itemid = $item['itemid'];在其上面换行加上$moduledir = $MOD['moduledir'];
2、找到url规则文件 api/url.inc.php

搜索$urls['php']['item'] = array('example'=>'('.$L['url_rewrite'].') show/1/','index'=>'show/{$itemid}/', 'page'=>'show/{$itemid}/{$page}/');

在下面加上$urls['php']['item'] = array('example'=>'('.$L['url_rewrite'].') moduledir-1-2.html','index'=>'../{$moduledir}-{$itemid}.html', 'page'=>'../{$moduledir}-{$itemid}-{$page}.html');


3、伪静态规则,目前只提供两个版本的,其他自行转行3-1、nginx版#根目录化S
rewrite ^(.*)-(+)([\-])?(+)?\.html$ $1/show.php?itemid=$2&page=$4 last;
#根目录化E
3-2、apache版规则#根目录化S
RewriteRule ^(.*)-(+)([\-])?(+)?\.html$ $1/show.php?itemid=$2&page=$4
#根目录化E

页: [1]
查看完整版本: destoon详情页url根目录化以模块目录名区分