增强站内标签关联性,支持给门户文章、论坛贴子和家园日志增加标签以及标签伪静态。
(如有安装使用问题请发上网址和截图到邮箱onexin@qq.com,新手QQ群:189610242)
成功安装站点:
ONEXIN演示
=================标签网址方案=============================
方案一:
http://demo.onexin.com/tag.html
http://demo.onexin.com/tag-110.html
方案二:
http://demo.onexin.com/tag/
http://demo.onexin.com/tag/影响力/
方案三:
http://demo.onexin.com/tag/
http://demo.onexin.com/tag/影响力.html
注:推荐固定使用其中一种方案。
=================伪静态规则=================
# 标签
RewriteRule ^tag(_([0-9]+))?(/|\.html)?$ plugin.php?id=onexin_tags&page=$2&%1
RewriteRule ^tag-(\d+)(-(\d+))?(/|\.html)?$ plugin.php?id=onexin_tags&tagid=$1&page=$3&%1
RewriteRule ^tag/([^\/\.]+)(/(\d+))?(/|\.html)?$ plugin.php?id=onexin_tags&tagname=$1&page=$3&%1
注意:新版请更新伪静态规则
-
当前版本
伪静态版 3.9.6
-
2021-05-16 23:00
伪静态版 3.9
-
2020-06-28 15:55
伪静态版 3.8
-
2020-05-27 11:58
伪静态优化版 3.6.0
-
2019-06-27 17:09
标准版带伪静态 3.1.0
更多历史版本信息
3.9.6
优化中文标签
修复已知BUG
3.9
优化标签摘要信息
优化部分代码
3.8
优化百度收录中文标签链接显示
3.6
优化翻页伪静态
优化贴子查看权限
修复已知BUG
支持伪静态目录化或.html形式,
支持标签加入meta关键字
支持文章中文标签
一、空标签404优化:
if(empty($tag['tagname'])) {
header("HTTP/1.1 404 Not Found");
showmessage('thread_nonexistence');
}
// $tag = DB::fetch_first("SELECT * FROM ".DB::table('common_tag')." WHERE tagid = '$id'");
// $metakeywords = !empty($tag['keywords']) ? dhtmlspecialchars($tag['keywords']) : ($tagname ? $tagname : $taglang);
// $metadescription = !empty($tag['description']) ? dhtmlspecialchars($tag['description']) : ($tagname ? $tagname : $taglang);
二、伪静态规则,放在其它DZ规则的上面,如:thread规则这一行上面
# IIS/APACHE Web Server 1
RewriteRule ^(.*)/tag(_([0-9]+))?(/|\.html)?$ $1/plugin\.php\?id=onexin_tags&page=$3&%1
RewriteRule ^(.*)/tag-(\d+)(-(\d+))?(/|\.html)?$ $1/plugin\.php\?id=onexin_tags&tagid=$2&page=$4&%1
RewriteRule ^(.*)/tag/([^\/\.]+)(/(\d+))?(/|\.html)?$ $1/plugin\.php\?id=onexin_tags&tagname=$2&page=$4&%1
# IIS/APACHE Web Server 2
RewriteRule ^tag(_([0-9]+))?(/|\.html)?$ plugin.php?id=onexin_tags&page=$2&%1
RewriteRule ^tag-(\d+)(-(\d+))?(/|\.html)?$ plugin.php?id=onexin_tags&tagid=$1&page=$3&%1
RewriteRule ^tag/([^\/\.]+)(/(\d+))?(/|\.html)?$ plugin.php?id=onexin_tags&tagname=$1&page=$3&%1
# Nginx Web Server
rewrite ^([^\.]*)/tag(_([0-9]+))?(/|\.html)?$ $1/plugin.php?id=onexin_tags&page=$3 last;
rewrite ^([^\.]*)/tag-(\d+)(-(\d+))?(/|\.html)?$ $1/plugin.php?id=onexin_tags&tagid=$2&page=$4 last;
rewrite ^([^\.]*)/tag/([^\/\.]+)(/(\d+))?(/|\.html)?$ $1/plugin.php?id=onexin_tags&tagname=$2&page=$4 last;
# IIS 7.x及以上 Web Server(独立主机用户)
<rule name="onexin_tag_1">
<match url="^(.*/)*tag(_([0-9]+))?(/|\.html)?$" />
<action type="Rewrite" url="{R:1}/plugin.php\?id=onexin_tags&page={R:3}" />
</rule>
<rule name="onexin_tag_2">
<match url="^(.*/)*tag-(\d+)(-(\d+))?(/|\.html)?$" />
<action type="Rewrite" url="{R:1}/plugin.php\?id=onexin_tags&tagid={R:2}&page={R:4}" />
</rule>
<rule name="onexin_tag_3">
<match url="^(.*/)*tag/([^\/\.]+)(/(\d+))?(/|\.html)?$" />
<action type="Rewrite" url="{R:1}/plugin.php\?id=onexin_tags&tagname={R:2}&page={R:4}" />
</rule>
=================网址说明=============================
旧规则
http://demo.onexin.com/tag.html
http://demo.onexin.com/tag-110.html
新规则(推荐目录化写法)
http://demo.onexin.com/tag/
http://demo.onexin.com/tag/影响力/