花魁直播高品质美女在线视频互动社区 - 花魁直播官方版

 歡迎來(lái)到素材無(wú)憂網(wǎng),按 + 收藏我們
登錄 注冊(cè) 退出 找回密碼

Discuz門戶文章列表頁(yè)偽靜態(tài)設(shè)置教程

時(shí)間: 2019-05-24 11:57 閱讀: 作者:素材無(wú)憂網(wǎng)

discuz后臺(tái)的偽靜態(tài)配置沒(méi)有門戶頻道的偽靜態(tài)。下面加上這個(gè)功能。 第一步:加上語(yǔ)言包中的記錄: 根目錄下:source/language/lang_admincp.php,找到setting_seo_rewritestatus_portal_article這一行,大概在1500行左右,搜索一下吧。 在這句下面加上一句: 'setting_seo_rewritestatus_portal_list' => '門戶頻道頁(yè)', 復(fù)制代碼 第二步:在后臺(tái)加上設(shè)置項(xiàng) 根目錄下:source/function/function_admincp.php,找到rewritedata函數(shù),在if語(yǔ)句的,兩個(gè)大括號(hào)中,加上下面兩段程序 上面一段加上
<span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;">      if (in_array('portal_list', $_G['setting']['rewritestatus'])) {</span>
<span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;">            $data['search']['portal_list'] = "/" . $_G['domain']['pregxprw']['portal'] . "\?mod\=list&(amp;)?catid\=(\d+)(&page\=(\d+))?\"([^\>]*)\>/e";</span>
<span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;">            $data['replace']['portal_list'] = "rewriteoutput('portal_list', 0, '\\1', '\\3', '\\5', '\\6')";</span>
<span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;">        }</span>

下面一段加上
<span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;">        $data['rulesearch']['portal_list'] = 'list-{catid}-{page}.html';</span>
<span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;">        $data['rulereplace']['portal_list'] = 'portal.php?mod=list&catid={catid}&page={page}';</span>
<span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;">        $data['rulevars']['portal_list']['{catid}'] = '([0-9]+)';</span>
<span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;">        $data['rulevars']['portal_list']['{page}'] = '([0-9]+)';</span>

第三步:兼容欄目頁(yè)URL地址設(shè)置 找到文件: 根目錄source/function/function_portal.php下的函數(shù)getportalcategoryurl 重新寫成下面的代碼:   第四步:設(shè)置前臺(tái)頁(yè)面URL地址切換 根目錄source/function/function_core.php這個(gè)文件中找到:函數(shù)rewriteoutput 在一串的if ... else if中加上一段
<span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;">elseif ($type == 'portal_list') {</span>
<span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;">        list(,,, $id, $page, $extra) = func_get_args();</span>
<span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;">        $r = array(</span>
<span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;">            '{catid}' => $id,</span>
<span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;">            '{page}' => $page ? $page : 1,</span>
<span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;">        );</span>
<span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;">    }</span>
IIS6偽靜態(tài)規(guī)則: [ISAPI_Rewrite]   # 3600 = 1 hour CacheClockRate 3600   RepeatLimit 32  
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/list-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/portal\.php\?mod=list&catid=$2&page=$3&$5
RewriteRule ^(.*)/topic-(.+)\.html(\?(.*))*$ $1/portal\.php\?mod=topic&topic=$2&$4
RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/portal\.php\?mod=view&aid=$2&page=$3&$5
RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$5
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$6
RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=group&fid=$2&page=$3&$5
RewriteRule ^(.*)/space-(username|uid)-(.+)\.html(\?(.*))*$ $1/home\.php\?mod=space&$2=$3&$5
RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/home\.php\?mod=space&uid=$2&do=blog&id=$3&$5
RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.html(\?(.*))*$ $1/index\.php\?action=$2&value=$3&$5
RewriteRule ^(.*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html(\?(.*))*$ $1/plugin\.php\?id=$2:$3&$5
復(fù)制代碼
IIS7偽靜態(tài)規(guī)則
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
                <rewrite>
                        <rules>
                                <rule name="portal_topic">
                                        <match url="^(.*/)*topic-(.+).html\?*(.*)[        DISCUZ_CODE_2        ]quot; />
                                        <action type="Rewrite" url="{R:1}/portal.php\?mod=topic&topic={R:2}&{R:3}" />
                                </rule>
                                <rule name="portal_list">
                                        <match url="^(.*/)*list-([0-9]+)-([0-9]+).html\?*(.*)[        DISCUZ_CODE_2        ]quot; />
                                        <action type="Rewrite" url="{R:1}/portal.php\?mod=list&catid={R:2}&page={R:3}&{R:4}" />
                                </rule>
                                <rule name="portal_article">
                                        <match url="^(.*/)*article-([0-9]+)-([0-9]+).html\?*(.*)[        DISCUZ_CODE_2        ]quot; />
                                        <action type="Rewrite" url="{R:1}/portal.php\?mod=view&aid={R:2}&page={R:3}&{R:4}" />
                                </rule>
                                <rule name="forum_forumdisplay">
                                        <match url="^(.*/)*forum-(\w+)-([0-9]+).html\?*(.*)[        DISCUZ_CODE_2        ]quot; />
                                        <action type="Rewrite" url="{R:1}/forum.php\?mod=forumdisplay&fid={R:2}&page={R:3}&{R:4}" />
                                </rule>
                                <rule name="forum_viewthread">
                                        <match url="^(.*/)*thread-([0-9]+)-([0-9]+)-([0-9]+).html\?*(.*)[        DISCUZ_CODE_2        ]quot; />
                                        <action type="Rewrite" url="{R:1}/forum.php\?mod=viewthread&tid={R:2}&extra=page%3D{R:4}&page={R:3}&{R:5}" />
                                </rule>
                                <rule name="group_group">
                                        <match url="^(.*/)*group-([0-9]+)-([0-9]+).html\?*(.*)[        DISCUZ_CODE_2        ]quot; />
                                        <action type="Rewrite" url="{R:1}/forum.php\?mod=group&fid={R:2}&page={R:3}&{R:4}" />
                                </rule>
                                <rule name="home_space">
                                        <match url="^(.*/)*space-(username|uid)-(.+).html\?*(.*)[        DISCUZ_CODE_2        ]quot; />
                                        <action type="Rewrite" url="{R:1}/home.php\?mod=space&{R:2}={R:3}&{R:4}" />
                                </rule>
                                <rule name="home_blog">
                                        <match url="^(.*/)*blog-([0-9]+)-([0-9]+).html\?*(.*)[        DISCUZ_CODE_2        ]quot; />
                                        <action type="Rewrite" url="{R:1}/home.php\?mod=space&uid={R:2}&do=blog&id={R:3}&{R:4}" />
                                </rule>
                                <rule name="forum_archiver">
                                        <match url="^(.*/)*(fid|tid)-([0-9]+).html\?*(.*)[        DISCUZ_CODE_2        ]quot; />
                                        <action type="Rewrite" url="{R:1}/index.php\?action={R:2}&value={R:3}&{R:4}" />
                                </rule>
                                <rule name="plugin">
                                        <match url="^(.*/)*([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+).html\?*(.*)[        DISCUZ_CODE_2        ]quot; />
                                        <action type="Rewrite" url="{R:1}/plugin.php\?id={R:2}:{R:3}&{R:4}" />
                                </rule>
                        </rules>
                </rewrite>
   </system.webServer>         
</configuration>
APACH偽靜態(tài)規(guī)則 # 將 RewriteEngine 模式打開(kāi) RewriteEngine On   # 修改以下語(yǔ)句中的  /RewriteBase /discuz 為您的論壇目錄地址,如果程序放在根目錄中,請(qǐng)將  /RewriteBase /discuz 修改為  / RewriteBase /discuz  
# Rewrite 系統(tǒng)規(guī)則請(qǐng)勿修改
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^list-([0-9]+)-([0-9]+)\.html$ portal.php?mod=list&catid=$1&page=$2&%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
Nginx偽靜態(tài)規(guī)則  
rewrite ^([^\.]*)/list-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=list&catid=$2&page=$3 last;
rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topicid=$2 last;
rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last;
rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;
rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last;
rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last;
rewrite ^([^\.]*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last;
rewrite ^([^\.]*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3 last;
rewrite ^([^\.]*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ $1/plugin.php?id=$2:$3 last;
if (!-e $request_filename) {
        return 404;
}

版權(quán)聲明: 本站資源均來(lái)自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!

轉(zhuǎn)載請(qǐng)注明: Discuz門戶文章列表頁(yè)偽靜態(tài)設(shè)置教程

標(biāo)簽:  
相關(guān)文章
模板推薦