栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP > php开源框架 > destoon

Destoon系统目录树SEO属性目录伪静态二次开发

destoon 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Destoon系统目录树SEO属性目录伪静态二次开发

Destoon系统目录树SEO属性目录伪静态二次开发

官方给的SEO伪静态实例是没有这个方式的

干脆自己做一个吧,已经测试完全无误通过,特意分享给大家


目前比如sell模块下类别【工程机械】的ID为:888 【工程机械】下面的子类为【配件系列】 ID为999我们要实现【工程机械】的二级伪静态目录为:www.domain.com/sell/888【配件系列】的二级目录伪静态为:www.domain.com/sell/888/999【工程机械】的下面所属的产品路径为:www.domain.com/sell/888/数字ID.html的方式【配件系列】的下面所有的产品路径应该为:www.domain.com/sell/888/999/数字ID.html的方式

如何设置呢:


第一步:修改伪静态数组文件

伪静态数组文件路径:api/url.inc.php

$urls['php']['list']数组增加一条:

此条语句是设置页面伪静态 www.domain.com/sell/888/ 和www.domain.com/sell/888/999/

$urls['php']['list'][6] = array('example'=>'('.$L['url_rewrite'].') /fatherID/sonID/','index'=>'{$parentid}/{$catid}/index.html', 'page'=>'{$parentid}/{$catid}/c-{$catid}-{$page}.html');

$urls['php']['item']数组增加一条:

此条语句是设置页面伪静态 www.domain.com/sell/888/999/数字ID.html 和 www.domain.com/sell/888/数字ID.html

$urls['php']['item'][5] = array('example'=>'('.$L['url_rewrite'].') /fatherID/sonID.show-1-2.htm','index'=>'{$parentid}/{$catid}/show-{$itemid}.html', 'page'=>'{$parentid}/{$catid}/show-{$itemid}-{$page}.html');

第二步:修改global/global.func.php文件
找到listurl函数
在$catid = $CAT['catid'];增加语句
$parentid=$CAT['parentid']?$CAT['parentid']:'';//读出目录的父ID
找到itemurl函数

if(strpos($url, 'cat') !== false && $catid) {                $cate = get_cat($catid);                $catdir = $cate['catdir'];                $catname = $cate['catname'];

增加语句
$parentid=$cate['parentid']?$cate['parentid']:'';//读出目录的父ID

第三步:找到网站.htaccess文件,增加下来伪静态语句

#这是内容页地址规则

RewriteRule ^(.*)/([0-9]+)/([0-9]+)/show-([0-9]+)([\-])?([0-9]+)?\.html$ $1/show.php?itemid=$4&page=$6
RewriteRule ^(.*)/([0-9]+)/show-([0-9]+)([\-])?([0-9]+)?\.html$ $1/show.php?itemid=$3&page=$5
RewriteRule ^(.*)/show-([0-9]+)([\-])?([0-9]+)?\.html$ $1/show.php?itemid=$2&page=$4
#这是列表页地址规则
RewriteRule ^(.*)/([A-za-z0-9_\-]+)/([A-za-z0-9_\-]+)/c-([0-9]+)-([0-9]+)\.html$ $1/list.php?catid=$4&page=$5
RewriteRule ^(.*)/([A-za-z0-9_\-]+)/c-([0-9]+)-([0-9]+)\.html$ $1/list.php?catid=$3&page=$4
RewriteRule ^(.*)/([0-9]+)/([0-9]+)/$ $1/list.php?catid=$3
RewriteRule ^(.*)/([0-9]+)/([0-9]+)?([/])?$ $1/list.php?catid=$2&page=$3

第四步:找到我们的伪静态规则设置选项
当然是网站后台了:
【功能模块】>> 【模块设置】 >>【SEO设置】>>【SEO优化】
PHP列表页地址规则 选择下拉列表:例 (伪静态) /fatherID/sonID/
PHP内容页地址规则 选择下拉列表:例 (伪静态) /fatherID/sonID.show-1-2.htm

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/218873.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号