您当前的位置:易学堂 > EM&TP

Emlog去除伪静态分类网址中的sort

时间:2019-02-12 17:23:20

把sort去掉,直接显示网址/分类别名的形式,这样有利于搜索引擎收录,也使网址更加简明。

需要修改的文件有两个(本站目前没有修改 内核改的太多 易乱):

include\lib\url.php
include\lib\dispatcher.php

修改方法:

在include\lib\url.php文件中

找到
$sortUrl = BLOG_URL . 'sort/' . $sort_index;
替换为
$sortUrl = BLOG_URL. $sort_index;
找到
$sortUrl = BLOG_URL . 'sort/' . $sort_index . '/page/';
替换为
$sortUrl = BLOG_URL . $sort_index . '/page/';

在include\lib\dispatcher.php文件中

找到
return $path;
替换为
if($path!="/"&&substr($path,0,6)!="/sort/"&&substr($path,0,2)!="/?") {
return "/sort".$path;
} else {
return $path;
}
标签: Emlogsort