
修改viewthread.php文件,在$page = max($page, 1);上面(程序调用包含文件结束),加一行$extrahead .='<link rel="canonical" href="thread-' .$tid. '-1-1.html" />';
帖子标题是$thread['subject'],按你的格式就是 $extrahead .=
'';
不过你的程序将帖子标题做为URL一部分,肯定要对$thread['subject']进行规范化处理,可以看看程序,用处理后的变量才准确。 ...
SEO小工 发表于 2009-4-18 20:10
二.给forumdisplay.php加canonical tag
在include template('forumdisplay');上加一行:
$extrahead .='<link rel="canonical" href="forum-' .$fid. '-' .$page. '.html" />';
| 欢迎光临 SEO半亩田 (http://seo.banmutian.org/) | Powered by Discuz! 7.0.0 |