Discuz! 论坛版块分区如何设置伪静态?-Discuz教程下载

Discuz! 论坛版块分区如何设置伪静态?

开通本站Svip会员,全站资源免费下

修改前:https://www.tuyuanma.com/forum.php?gid=1
修改后效果:https://www.tuyuanma.com/exo/1

教程如下:

第一步:找到并打开文件Discuz.htm,    路径 \template\default\forum
找到以下代码:

  1. <font color="rgb(0, 0, 0)"><font style="font-size: 13px"><h2><a href="{if !empty($caturl)}$caturl{else}forum.php?gid=$cat[fid]{/if}" style="{if $cat[extra][namecolor]}color: {$cat[extra][namecolor]};{/if}">$cat[name]</a></h2></font></font>
复制代码

把它替换成以下代码:

  1. <font color="rgb(0, 0, 0)"><font style="font-size: 13px"><h2><a href="{if !empty($caturl)}$caturl{else}q/$cat[fid]{/if}" style="{if $cat[extra][namecolor]}color: {$cat[extra][namecolor]};{/if}">$cat[name]</a></h2></font></font>
复制代码

复制代码


discuz.htm 文件修改完成,保存。

第二步:打开伪静态规则文件httpd.ini或.htaccess:
如果是httpd.ini,则在里面添加如下伪静态规则:

  1. <font color="rgb(0, 0, 0)"><font style="font-size: 13px">RewriteRule ^(.*)/exo/(\w+)\.html(\?(.*))*[        DISCUZ_CODE_14        ]nbsp; $1/forum\.php\?gid=$2&$4</font></font>
复制代码

如果是.htaccess,则在里面添加如下伪静态规则:

  1. <font color="rgb(0, 0, 0)"><font style="font-size: 13px">RewriteCond %{QUERY_STRING} ^(.*)$
  2. RewriteRule ^exo/(\w+)$ forum\.php\?gid=$1&$1</font></font>
复制代码

保存。

把上面两个修改的文件上传服务器,后台更新缓存。即可。
完毕,有疑问,回复提出。


全部评论 0

您需要登录后才可以回帖 立即登录
登录
0
0
0
返回顶部