4、“只看该作者”伪静态化。打开 forum/viewthread_node.htm (或可能为viewthread_node_body.htm)模板文件,查找:
<span class="pipe">|</span>
<!--{if !IS_ROBOT && !$_GET['authorid'] && !$_G['forum_thread']['archiveid']}-->
...
<!--{elseif !$_G['forum_thread']['archiveid']}-->
...
<!--{/if}-->
将整个if段替换为:
<!--{if !IS_ROBOT && !$_GET['authorid'] && !$_G['forum_thread']['archiveid']}-->
<span class="pipe">|</span>
<a href="thread-$post[tid]-1-u{$post[authorid]}.html" rel="nofollow">{lang thread_show_author}</a>
<!--{elseif !IS_ROBOT && !$_G['forum_thread']['archiveid']}-->
<span class="pipe">|</span>
<a href="forum.php?mod=viewthread&tid=$post[tid]&page=$page" rel="nofollow">{lang thread_show_all}</a>
<!--{/if}-->
5、“倒序/正序看帖”伪静态化。打开 forum/viewthread_node.htm (或可能为viewthread_node_body.htm)模板文件,查找:
<!--{if $ordertype != 1}-->
...
<!--{else}-->
...
<!--{/if}-->
将整个if段替换为:
<!--{if $ordertype != 1}-->
<span class="pipe show">|</span><a href="thread-$_G[tid]-1-o1.html" rel="nofollow" class="show">{lang post_descview}</a>
<!--{else}-->
<span class="pipe show">|</span><a href="thread-$_G[tid]-1-o2.html" rel="nofollow" class="show">{lang post_ascview}</a>
<!--{/if}-->
6、“只看大图”和“打印”“上一主题/下一主题”链接伪静态化。
打开 forum/viewthread_node.htm 模板文件,查找 <a href="forum.php?mod=viewthread&tid=$_G[tid]&from=album">{lang view_bigpic}</a> 替换为: <a href="thread-$_G[tid]-album.html" rel="nofollow"><font color="#336699">相册模式</font></a> 。
打开 forum/viewthread.htm 模板文件,查找: forum.php?mod=viewthread&action=printable&tid=$_G[tid] 替换为:printable-$_G[tid].html 。查找: forum.php?mod=redirect&goto=nextoldset&tid=$_G[tid] 替换为: thread-$_G[tid]-prev.html 。超找: forum.php?mod=redirect&goto=nextnewset&tid=$_G[tid] 替换为: thread-$_G[tid]-next.html 。
打开 source/module/forum/forum_redirect.php 文件,将:
if($next) {
dheader("Location: forum.php?mod=viewthread&tid=$next");
} elseif($_GET['goto'] == 'nextnewset') {
showmessage('redirect_nextnewset_nonexistence');
} else {
showmessage('redirect_nextoldset_nonexistence');
}
替换为:
if($next) {
dheader("Location: thread-$next-1-1.html");
} elseif($_GET['goto'] == 'nextnewset') {
header('HTTP/1.1 404 Not Found');
showmessage('redirect_nextnewset_nonexistence');
} else {
header('HTTP/1.1 404 Not Found');
showmessage('redirect_nextoldset_nonexistence');
}
若您喜欢这篇文章,欢迎订阅老张小站以获得最新内容。 / 欢迎交流探讨,请发电子邮件至 mail[at]vdazhang.com 。
/2015-03-08 15:05这个伪静态Apache Web Server规则怎么写呢?
/2015-03-12 21:06基本差不多。你比较一下官方默认规则两者的区别就知道了。