Destoon系統目錄樹SEO屬性目錄開發例項

2022-07-13 06:57:15 字數 2338 閱讀 2771

如何在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'=>'', 'page'=>'');

$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'=>'', 'page'=>'');

第二步:修改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

destoon 系統常量與變數

常量 說明備註 dt root 站點物理路徑 dt path 站點首頁 dt skin 風格目錄 dt admin 是否在管理後台 dt domain cookie作用域 dt lang 站點語言 dt key 安全金鑰 dt charset 字元編碼 dt cache 快取目錄物理路徑 dt ve...

destoon 系統常量與變數

常量 說明備註 dt root 站點物理路徑 dt path 站點首頁 dt skin 風格目錄 dt admin 是否在管理後台 dt domain cookie作用域 dt lang 站點語言 dt key 安全金鑰 dt charset 字元編碼 dt cache 快取目錄物理路徑 dt ve...

destoon 系統常量與變數

常量 說明備註 dt root 站點物理路徑 dt path 站點首頁 dt skin 風格目錄 dt admin 是否在管理後台 dt domain cookie作用域 dt lang 站點語言 dt key 安全金鑰 dt charset 字元編碼 dt cache 快取目錄物理路徑 dt ve...