Discuz教程网

[代码修改] discuz如何去掉#lastpost动态链接,实现搜索引擎优化

[复制链接]
authicon 小白 发表于 2013-4-5 10:36:05 | 显示全部楼层 |阅读模式
方法是到你正在使用的模板的目录小下找“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]&goto=lastpost#lastpost">{echo cutstr($forum[lastpost][subject], 30)}</a></p>
复制代码
将其中的 “<a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">”

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

来到此处(约第97行):
游客,如果您要查看本帖隐藏内容请回复
同上,将

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

这样的静态url形式了



上一篇:7.2和7.1安装稳定版首页4格5格XShowv1.2.70 for 7.2(绝对可安装使用)
下一篇:Discuz 7.X细节优化SEO
authicon 普洛文化 发表于 2014-11-21 14:24:38 | 显示全部楼层
學習了,馬上來試看看
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2025-5-2 07:16

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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