zoukankan      html  css  js  c++  java
  • Destoon系统目录树SEO属性目录开发实例

    如何在destoon里设置树形目录结构的SEO优化方式
    官方给的SEO伪静态实例是没有这个方式的

    楼主后来想了一下,就干脆自己做一个吧,已经测试完全无误通过,特意分享给大家

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

    第一步:修改伪静态数组文件
    伪静态数组文件路径:api/url.inc.php
    $urls['php']['list']数组增加一条:
    此条语句是设置页面伪静态 www.68v8.com/sell/888/ 和 www.68v8.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.68v8.com/sell/888/999/数字ID.html 和 www.68v8.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


  • 相关阅读:
    Yarn和Mesos:资源管理调度平台
    链接、装载、库
    PostgreSQL查询优化简介
    STL内存管理
    jemalloc总结
    ptmalloc总结
    数据库查询优化
    Linux交换空间和内存不足
    Linux内存管理
    HBase:分布式列式NoSQL数据库
  • 原文地址:https://www.cnblogs.com/keleyu/p/11757615.html
Copyright © 2011-2022 走看看