discuz x3.3论坛分区url伪静态化去除forum.php?gid=的方法免费分享了,赶紧将自己的论坛改为易收录的链接吧,绝对正确!
打开 forum/discuz.htm
文件搜索
<a href="{if !empty($caturl)}$caturl{else}forum.php?gid=$cat[fid]{/if}"
将
forum.php?gid=$cat[fid]
替换为
forum-$cat[fid].html
版块页:打开 source/module/forum/forum_forumdisplay.php
文件搜索
将
Location: forum.php?gid=$_G[fid]
替换为
Location: forum-$_G[fid].html
将
forum.php?gid='.$forum_up['fid'].'
替换为
forum-'.$forum_up['fid'].'.html
将
forum.php?gid='.$forum_top['fid'].'
替换为
forum-'.$forum_top['fid'].'.html
帖子页:打开 source/module/forum/forum_viewthread.php 文件
将
? 'forum.php?gid='.$fup :
替换为
? 'forum-'.$fup.'.html' :
有两个地方需要修改
发帖页:打开 source/module/forum/forum_post.php 文件
将
? 'forum.php?gid='.$fup :
替换为
? 'forum-'.$fup.'.html' :
有两个地方需要修改
伪静态规则在红色标注的地方
# 将 RewriteEngine 模式打开
RewriteEngine On
# 修改以下语句中的 /discuz 为您的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 /
RewriteBase /
# 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-([0-9]+)/.html$ forum.php?gid=$1&%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 ^(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
新闻热点
疑难解答