Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

discuz如何去掉#lastpost动态链接,实现搜索引擎优化

[复制链接]
tiger21 发表于 2010-4-20 04:26:44 | 显示全部楼层 |阅读模式
插件发布
插件名称: discuz如何去掉#lastpost动态链接,实现搜索引擎优化
插件来源:
适用版本: Discuz! 7.2
语言编码: GBK简体 
最后更新时间:
插件作者: http://wiki.deepst.com/cn/353
插件简介: discuz如何去掉#lastpost动态链接,实现搜索引擎优化
本帖最后由 tiger21 于 2010-4-20 04:37 编辑

知道为什么我们论坛开启了 rewrite 功能,google 收录中 还是出现 lastpost 字眼的帖子吗?




原因就是因为


刚刚在discuz论坛内发现一个连接,过去看看知道了修改方法

方法是到你正在使用的模板的目录小下找“discuz.htm”

如果没有到默认目录下找
templates/default/discuz.htm
用编辑器打开,注意不要用windows 自带的记事本

搜索“lastpost ”

来到此处(约第67行):
  1. <!–{elseif is_array($forum['lastpost'])}–>
  2. <p><a href=”redirect.php?tid=$forum[lastpost][tid]&amp;goto=lastpost#lastpost”>{echo cutstr($forum[lastpost][subject], 30)}</a></p>
复制代码
将其中的

  1. “<a href=”redirect.php?tid=$forum[lastpost][tid]&amp;goto=lastpost#lastpost”>”
复制代码
修改为

  1. <a href=”thread-$forum[lastpost][tid]-1-1.html”>
复制代码
再向下搜索

来到此处(约第97行):
  1. <p>{lang forum_lastpost}:
  2. <!–{if is_array($forum['lastpost'])}–>
  3. <a href=”redirect.php?tid=$forum[lastpost][tid]&amp;goto=lastpost#lastpost” title=”{echo cutstr($forum[lastpost][subject], 30)} {lang forum_lastpost_by} {if $forum['lastpost']['author']}$forum['lastpost']['authorusername']{else}{lang anonymous}{/if} “>$forum[lastpost][dateline]</a>
复制代码
同上,将

将其中的

  1. “<a href=”redirect.php?tid=$forum[lastpost][tid]&amp;goto=lastpost#lastpost”>”
复制代码
修改为

  1. <a href=”thread-$forum[lastpost][tid]-1-1.html”>
复制代码
修改完后,dz论坛首页的最好发表链接就变成类似“thread-xxx-1-1.html”

这样的静态url形式了


资料来源 : http://wiki.deepst.com/cn/353

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
 楼主| tiger21 发表于 2010-4-20 04:27:47 | 显示全部楼层
保留。。。。。。。。。。。。。。。。。。。。
回复

使用道具 举报

滚骨碌 发表于 2010-4-20 08:34:15 | 显示全部楼层
这样就不能跳到最后看回帖内容了吧?
回复

使用道具 举报

michaelowenii 发表于 2010-4-20 09:11:54 | 显示全部楼层
这样就不能跳到最后看回帖内容了吧?
回复

使用道具 举报

hellokai 发表于 2010-4-20 09:55:31 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

jm611 发表于 2010-4-20 09:59:13 | 显示全部楼层
不错啊。。收藏了
回复

使用道具 举报

 楼主| tiger21 发表于 2010-4-20 16:08:14 | 显示全部楼层
顶上去 。。。。。。。。。。。。。。。
回复

使用道具 举报

上山下石 发表于 2010-4-20 16:27:35 | 显示全部楼层
不错啊。。收藏了
回复

使用道具 举报

lt173 发表于 2010-9-26 14:29:45 | 显示全部楼层
DZ1.5无法实现
回复

使用道具 举报

eagleer 发表于 2010-11-16 16:15:54 | 显示全部楼层
DZ1.5怎么改?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-21 06:51 , Processed in 0.236836 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表