用户注册



邮箱:

密码:

用户登录


邮箱:

密码:
记住登录一个月忘记密码?

发表随想


还能输入:200字

免费源代码下载整理    -  云代码空间

—— 每天更新整理各种PHP、JSP、ASP源代码,敬请关注我的微博 http://weibo.com/freecodedownload

discuz x2.5linux主机如何去掉forum.php尾巴

2013-07-21|11511阅||

摘要:discuz x2.5linux主机如何去掉forum.php尾巴,今天为大家解释一番http:///bbs/forum.phpdiscuz x2.5如何去除forum.php,我们使用discuz程序创建的网站后,会发现在域名访问后面总有forum.php。对于搜索引擎来说。这

discuz x2.5linux主机如何去掉forum.php尾巴,今天为大家解释一番http:///bbs/forum.php
discuz x2.5如何去除forum.php,我们使用discuz程序创建的网站后,会发现在域名访问后面总有forum.php。对于搜索引擎来说。这样会造成域名的权重分散,非常不利于seo,为了更加集中权重。我们这里通过修改discuz的一些程序,将forum.php去掉。

其实关于discuz x2.5如何去除forum.php也不复杂,只需要更改几个模板就可以了。下面我们将学习对discuz x2.5如何去除forum.php。

1、其它地方的forum.php尾巴就需要去模板里面修改了,路径是template\default\forum,然后分别找到discuz.htm、forumdisplay.htm、viewthread.htm这三个文件,打开后找到<a href=”forum.php”],替换成<a href=”./”],就OK了,每个文件里面都只有一个需要修改的,所以不要搞错了,要先看清楚再改,
2、还有一个地方,也是同样的方法修改,路径是source\archiver\forum,都是根目录下的路径哦,找到discuz.php文件,同样把<a href=”forum.php”]替换成<a href=”./”]就全部完成了
那我的4个文件是如何更改的呢?
discuz.htm
<div class=&quot;z&quot;]
&nbsp; &nbsp; &nbsp; &nbsp;<a href=&quot;./&quot; class=&quot;nvhm&quot; title=&quot;{lang homepage}&quot;]$_G[setting][bbname]</a]<em]&raquo;</em]<a href=&quot;forum.php&quot;{if $_G['setting']['forumjump']} id=&quot;fjump&quot; class=&quot;showmenu&quot;{/if}]{$_G[setting][navs][2][navname]}</a]$navigation
&nbsp; &nbsp;</div]
forumdisplay.htm
<div class=&quot;z&quot;]
&nbsp; &nbsp; &nbsp; &nbsp;<a href=&quot;/bbs/&quot; class=&quot;nvhm&quot; title=&quot;{lang homepage}&quot;]$_G[setting][bbname]</a]<em]&raquo;</em]<a href=&quot;/bbs/&quot;{if $_G['setting']['forumjump']} id=&quot;fjump&quot; class=&quot;showmenu&quot; {/if}]{$_G[setting][navs][2][navname]}</a]$navigation
&nbsp; &nbsp;</div]
viewthread.htm
&nbsp;  <div class=&quot;z&quot;]
&nbsp; &nbsp; &nbsp; &nbsp;<a href=&quot;./&quot; class=&quot;nvhm&quot; title=&quot;{lang homepage}&quot;]$_G[setting][bbname]</a]<em]&raquo;</em]<a href=&quot;forum.php&quot;{if $_G['setting']['forumjump']} id=&quot;fjump&quot; class=&quot;showmenu&quot; {/if}]{$_G[setting][navs][2][navname]}</a]$navigation <em]??</em] <a href=&quot;forum.php?mod=viewthread&tid=$_G[tid]&quot;]$_G[forum_thread][short_subject]</a]
&nbsp; &nbsp;</div]
discuz.php
<div id=&quot;nav&quot;]
&nbsp; &nbsp;<a href=&quot;./&quot;]<strong]<?php echo $_G['setting']['bbname']; ?]</strong]</a]
</div]

3、就是伪静态里面加上

#默认首页设置
DirectoryIndex forum.php index.html index.php default.html


linux主机 伪静态规则
# 将 Rewrite Engine 模式打开
Rewrite Engine On


# Rewrite 系统规则请勿修改
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ plugin.php?id=$12&%1
#默认首页设置

DirectoryIndex forum.php index.html index.php default.html

易兴在百度中找了许许多多的方法,真的找不到合适的方法,我就打算放弃,想花钱去做,就开始在网上找啊找。
找到一个什么CMS的创始人、去一个forum.php尾巴给我要500元。哎, 在舍不得花钱的情况下。我研究了3天2夜。终于研究出来方法。希望想修改论坛网址尾巴的童鞋,按着 我的方法保证100%去掉. 100%的原创。 
顶 7踩 3收藏
文章评论
    发表评论

    个人资料

    • 昵称: 免费源代码下载整理
    • 等级: 资深程序员
    • 积分: 1676
    • 代码: 110 个
    • 文章: 56 篇
    • 随想: 5 条
    • 访问: 425 次
    • 关注

    最新提问

      站长推荐