网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > Discuz/SupeSite/X-Space
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

Discuz/SupeSite/X-Space 讨论Discuz安装、升级、模板、插件、源代码修改以及使用技巧等。

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   IP: 112.87.85.34
Old 2013-03-02, 01:49 PM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default DZ如何去掉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="z">
<a href="./" class="nvhm" title="{lang homepage}">$_G[setting][bbname]</a><em>&raquo;</em><a href="forum.php"{if $_G['setting']['forumjump']} id="fjump" onmouseover="delayShow(this, 'showForummenu($_G[fid])');" class="showmenu"{/if}>{$_G[setting][navs][2][navname]}</a>$navigation
</div>
forumdisplay.htm
<div class="z">
<a href="/bbs/" class="nvhm" title="{lang homepage}">$_G[setting][bbname]</a><em>&raquo;</em><a href="/bbs/"{if $_G['setting']['forumjump']} id="fjump" onmouseover="delayShow(this, 'showForummenu($_G[fid])');" class="showmenu" {/if}>{$_G[setting][navs][2][navname]}</a>$navigation
</div>
viewthread.htm
<div class="z">
<a href="./" class="nvhm" title="{lang homepage}">$_G[setting][bbname]</a><em>&raquo;</em><a href="forum.php"{if $_G['setting']['forumjump']} id="fjump" onmouseover="delayShow(this, 'showForummenu($_G[fid])');" class="showmenu" {/if}>{$_G[setting][navs][2][navname]}</a>$navigation <em>&rsaquo;</em> <a href="forum.php?mod=viewthread&tid=$_G[tid]">$_G[forum_thread][short_subject]</a>
</div>
discuz.php
<div id="nav">
<a href="./"><strong><?php echo $_G['setting']['bbname']; ?></strong></a>
</div>
3、就是伪静态里面加上
#默认首页设置
DirectoryIndex forum.php index.html index.php default.html

linux主机 伪静态规则



# 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=$1:$2&%1
#默认首页设置

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

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


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 11:08 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.