电脑计算机论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2059|回复: 0

将Discuz的RSS中帖子地址静态化

[复制链接]
admin 发表于 2010-8-22 00:55:02 | 显示全部楼层 |阅读模式
Discuz论坛启用静态化后,RSS中的链接地址并没有静态化,还是动态地址。按照Discuz的robots文件的默认设置,rss.php文件是不会被搜索引擎索引的,也就不会出现重复URL。但实际情况是,很多情况下会用到RSS调用或者是聚合,这样rss中的动态地址还会被搜索引擎索引。下面我们将把RSS中显示的链接地址改成静态化的。

修改文件:rss.php

修改方法:

在rss.php中找到:
  • "&nbsp; &nbsp;&nbsp; &nbsp;<title>".dhtmlspecialchars($thread['subject'])."</title>\n".
  • "&nbsp; &nbsp;&nbsp; &nbsp;<link>{$boardurl}viewthread.php?tid=$thread[tid]</link>\n".
  • "&nbsp; &nbsp;&nbsp; &nbsp;<description><![CDATA[$thread[description]]]></description>\n".
  • "&nbsp; &nbsp;&nbsp; &nbsp;<category>".dhtmlspecialchars($thread['forum'])."</category>\n".
  • "&nbsp; &nbsp;&nbsp; &nbsp;<author>".dhtmlspecialchars($thread['author'])."</author>\n".
  • "&nbsp; &nbsp;&nbsp; &nbsp;<pubDate>".gmdate('r', $thread['dateline'])."</pubDate>\n".
  • "&nbsp; &nbsp; </item>\n";

复制代码
将其中的
  • <link>{$boardurl}viewthread.php?tid=$thread[tid]</link>\n".

复制代码
修改为:
  • <link>{$boardurl}thread-$thread[tid]-1-1.html</link>\n".

复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则


QQ|手机版|小黑屋|电脑计算机论坛 ( 京ICP备2022023538号-1 )

GMT+8, 2024-5-8 09:03 , Processed in 0.072405 second(s), 20 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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