Discuz! X3.4主題分類和分類信息偽靜態設置方法

實現方法:
編輯:
\source\function\function_admincp.php
查找:(約1250~1253行)

if (in_array('forum_forumdisplay', $_G)) {
$data = "/" .$_G. "\?mod\=forumdisplay&(amp;)?fid\= (\w+)(&page\=(\d+))?"(*)\>/" ;
$data = 'rewriteoutput(\'forum_forumdisplay\', 0 , $matches, $matches, $matches, $matches)';
}
在其下行添加:

if (in_array('forum_forumdisplay_type', $_G)) {
$data = "/" .$_G. "\?mod\=forumdisplay&(amp;)?fid\= (\w+)(&typeid\=(\w+))?(&filter\=typeid)?(&typeid\=(\w+))?(&filter\=typeid)?(&page\=(\d+))?" (*)\>/e" ;
$data = "rewriteoutput('forum_forumdisplay_type', 0, $matches, $matches, $matches, $matches, $matches)" ;
}
查找:(約1299~1302行)

$data = 'forum-{fid}-{page}.html';
$data = 'forum.php?mod=forumdisplay&fid={fid}&page={page}';
$data = '(\w+)';
$data = '(+)';
在其下行添加:

$data = 'forum-{fid}-{typeid}-{page}.html';
$data = 'forum.php?mod=forumdisplay&fid={fid}&filter=typeid&typeid={typeid}&page={page}';
$data = '(\w+)';
$data = '(\w+)';
$data = '(+)';
編輯:
\source\function\function_core.php
查找:(約940~945行)

if ($type == 'forum_forumdisplay') {
list(,,, $fid, $page, $extra) = func_get_args();
$r = array(
'{fid}' => empty($_G) ? $fid : $_G,
'{page}' => $page ? $page : 1 ,
);
在其下行添加:

}
if ($type == 'forum_forumdisplay') {
list(,,, $fid, $page, $extra) = func_get_args();
$r = array(
'{fid}' => empty($_G) ? $fid : $_G,
'{page}' => $page ? $page : 1 ,
);
} elseif($type == 'forum_forumdisplay_type') {
list(,,, $fid, $typeid, $page, $extra) = func_get_args();
$r = array(
'{fid}' => empty($_G) ? $fid : $_G,
'{typeid}' => $typeid,
'{page}' => $page ? $page : 1 ,
);
編輯:
/source/language/lang_admincp.php
查找:(約1509行)

'setting_seo_rewritestatus_forum_forumdisplay' => '論壇主題列表頁',
在其下行添加:

'setting_seo_rewritestatus_forum_forumdisplay_type' => '論壇主題分類頁',
勾選提交之後,點擊右上角“查看當前的Rewrite規則”
在你的偽靜態規則添加你對應主機類型的相關偽靜態規則,
舉個例子,比如
Apache Web Server(虛擬主機用戶)環境:
.htaccess 添加如下規則,即可生效。
偽靜態規則:

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^forum-(\w+)-(\w+)-(+)\.htmlnbsp;forum.php?mod=forumdisplay&fid=$ 1 &filter=typeid&typeid=$ 2 &page=$ 3 &% 1 amp-img src="https://xn--hxtw09dumag66d.xn--kpry57d/ad/7448.jpg" width="320" height="240" layout="responsive">
分類