欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

代理加盟

2023全新代理計(jì)劃,一站式模板建站,銅牌代理低至699元送終身VIP,獨(dú)立代理后臺(tái),自營(yíng)貼牌。

您現(xiàn)在的位置: 麥站網(wǎng) > 織夢(mèng)大學(xué) > 使用教程 >

DedeCMS實(shí)現(xiàn)全站PHP偽靜態(tài)

來源:本站原創(chuàng) 發(fā)布時(shí)間:2019-03-31 12:01:16熱度: ℃我要評(píng)論(0

麥站模板建站平臺(tái)(10年經(jīng)驗(yàn)),服務(wù)數(shù)萬家企業(yè),固定透明報(bào)價(jià)。域名注冊(cè)、主機(jī)/服務(wù)器、網(wǎng)站源碼一站式服務(wù)。實(shí)體公司,專業(yè)團(tuán)隊(duì),值得選擇!超過1000套模板已登記版權(quán),合規(guī)合法建站,規(guī)避版權(quán)風(fēng)險(xiǎn)!【點(diǎn)擊獲取方案】

       偽靜態(tài)有利于搜索引擎的收錄,能夠增加網(wǎng)站的優(yōu)化效果,但要注意做偽靜態(tài)的時(shí)候,一定要正確書寫好代碼,一旦出現(xiàn)失誤,會(huì)導(dǎo)致搜索引擎抓取出現(xiàn)異常,需要對(duì)偽靜態(tài)進(jìn)行測(cè)試及及時(shí)跟蹤。進(jìn)一步了解偽靜態(tài),參考有關(guān)文章什么是網(wǎng)站偽靜態(tài)有什么好處。下面講解dedecmsV5.7gbk版本的全站偽靜態(tài)處理方法。

dedecms偽靜態(tài)

dedecms V5.7偽靜態(tài)設(shè)置方法步驟如下:

一 后臺(tái)-系統(tǒng)參數(shù)-核心設(shè)置-是否使用偽靜態(tài):選擇“是”;

       你的網(wǎng)站空間是否支持偽靜態(tài),你可以與空間的IDC商聯(lián)系一下,如果是自己的服務(wù)器,那就更好辦了,自己動(dòng)手,豐衣足食。一般來說,空間都是支持偽靜態(tài)的。Apache服務(wù)器偽靜態(tài)相對(duì)簡(jiǎn)單,直接在.htaccess文件中加入相應(yīng)偽靜態(tài)規(guī)則即可;而IIS服務(wù)器偽靜態(tài)的實(shí)現(xiàn),則需要加載Rewrite組件,然后配置httpd.ini文件。 

二 如果你的網(wǎng)站已經(jīng)存在生成的靜態(tài)欄目或文章HTML,在后臺(tái)-系統(tǒng)-SQL命令行工具中執(zhí)行如下語句:

        將所有文檔設(shè)置為“僅動(dòng)態(tài)瀏覽”:

update dede_archives set ismake=-1

        將所有欄目設(shè)置為“使用動(dòng)態(tài)頁(yè)”:

update dede_arctype set isdefault=-1

       兩個(gè)語句必須單獨(dú)執(zhí)行,不能同時(shí)執(zhí)行。

三 首頁(yè)偽靜態(tài)

       把站點(diǎn)根目錄下index.html刪除,以后不更新主頁(yè)HTML即可,當(dāng)然你也可以選擇不使用動(dòng)態(tài)首頁(yè)。

四 頻道、列表頁(yè)、文章頁(yè)偽靜態(tài)修改

       主要通過修改GetFileName()、GetTypeUrl()這兩個(gè)函數(shù)實(shí)現(xiàn)。打開/include/helpers/channelunit.helper.php。其他版本如DedeCms V5.3、DedeCms V5.5和DedeCms V5.6版本,打開/include/channelunit.func.php進(jìn)行修改。

(1)查找:
//動(dòng)態(tài)文章
if($cfg_rewrite == 'Y')
{
return $GLOBALS["cfg_plus_dir"]."/view-".$aid.'-1.html';
}

替換為

//動(dòng)態(tài)文章
if($cfg_rewrite == 'Y')
{
return "/view-".$aid.'-1.html';
}

       意思是:將默認(rèn)的 /plus/view-1-1.html 文章鏈接格式改為 /view-1-1.html。這個(gè)隨個(gè)人喜歡,不更改也行。

(2) 查找:
//動(dòng)態(tài)
$reurl = $GLOBALS['cfg_phpurl']."/list.php?tid=".$typeid;

替換為

//動(dòng)態(tài)
$reurl = "/list-".$typeid.".html";

       意思是:將默認(rèn)的頻道或是列表頁(yè)URL,/plus/list.php?tid=1 變更為/list-1.html形式,減少了一層目錄。

五 列表分頁(yè)偽靜態(tài)修改

       打開/include/arc.listview.class.php

查找:

$plist = str_replace('.php?tid=', '-', $plist);

替換為

$plist = str_replace('plus', 'category', $plist);//將默認(rèn)的plus替換成category
$plist = str_replace('.php?tid=', '-', $plist);

       意思是:將默認(rèn)的列表分頁(yè)鏈接格式 /plus/list-1-2-1.html 修改為 /category/list-1-2-1.html。這一步也可以不做更改。

六 文章分頁(yè)偽靜態(tài)

       打開/include/arc.archives.class.php,找到獲取動(dòng)態(tài)的分頁(yè)列表GetPagebreakDM()函數(shù)末尾處:

查找兩處的:

$PageList = str_replace(".php?aid=","-",$PageList);

替換為

$PageList = str_replace('plus', 'archives', $PageList);//將默認(rèn)的plus替換成archives
$PageList = str_replace(".php?aid=","-",$PageList);

       意思是:將默認(rèn)的文章分頁(yè)鏈接格式 plus/list-x-x-x.html 修改為 archives/list-x-x-x.html。這一步也可以不做更改。

七 TAG標(biāo)簽偽靜態(tài)

       DedeCms默認(rèn)的TAG標(biāo)簽URL,形如/tags.php?/dedecms模板 /,是不是覺得有個(gè)問號(hào)不怎么爽,我們改成/tags/dedecms模板 /,是不是好看多了。

       下面我們來改一下,打開/include/taglib/tag.lib.php

查找:

$row['link'] = $cfg_cmsurl."/tags.php?/".urlencode($row['keyword'])."/";

替換為

$row['link'] = $cfg_cmsurl."/tags/".urlencode($row['keyword'])."/";

       這樣就修改好了,上傳到你的網(wǎng)站,切記:要記得將原網(wǎng)站備份哦!

八 搜索偽靜態(tài)

       dedecms搜索的url偽靜態(tài)比較麻煩,附帶參數(shù)多不說,參數(shù)也可能變化,搜索結(jié)果分頁(yè)的url特別麻煩,只能偷下懶,將搜索url中的“search.php?...”直接替換為“search.html?...”

       依次打開include文件夾下的channelunit.func.php、arc.searchview.class.php、arc.taglist.class.php以及/include/taglib/hotwords.lib.php,查找“search.php?”替換為“search.html?”即可。

九 偽靜態(tài)規(guī)則:

       依照上面的步驟修改完畢,接下來配置好httpd.ini文件和.htaccess文件偽靜態(tài)規(guī)則,則DedeCms全站偽靜態(tài)就完美實(shí)現(xiàn)。

1.iis偽靜態(tài)

打開httpd.ini文件,加入如下規(guī)則:

#首頁(yè)偽靜態(tài)規(guī)則,如果不使用動(dòng)態(tài)首頁(yè),請(qǐng)勿必刪除這一行,否則打開首頁(yè)會(huì)出現(xiàn)死循環(huán)
RewriteRule ^(.*)/index\.html $1/index\.php [I]
#列表頁(yè)偽靜態(tài)規(guī)則
RewriteRule ^(.*)/category/list-([0-9]+)\.html $1/plus/list\.php\?tid=$2 [I]
RewriteRule ^(.*)/category/list-([0-9]+)-([0-9]+)-([0-9]+)\.html $1/plus/list\.php\?tid=$2&TotalResult=$3&PageNo=$4 [I]
#文章頁(yè)偽靜態(tài)規(guī)則
RewriteRule ^(.*)/archives/view-([0-9]+)-([0-9]+)\.html $1/plus/view\.php\?arcID=$2&pageno=$3 [I]
#搜索偽靜態(tài)規(guī)則
RewriteRule ^(.*)/search\.html(?:(\?.*))* $1/search\.php?$2 [I]
#TAG標(biāo)簽偽靜態(tài)規(guī)則
RewriteRule ^(.*)/tags\.html $1/tags\.php [I]
RewriteRule ^(.*)/tags/(.*)(?:(\?.*))* $1/tags\.php\?\/$2 [I]
RewriteRule ^(.*)/tags/(.*)\/(?:(\?.*))* $1/tags\.php\?\/$2\/ [I]
RewriteRule ^(.*)/tags/(.*)\/([0-9])(?:(\?.*))* $1/tags\.php\?\/$2\/$3 [I]
RewriteRule ^(.*)/tags/(.*)\/([0-9])\/(?:(\?.*))* $1/tags\.php\?\/$2\/$3\/ [I]
#問答偽靜態(tài)規(guī)則,適用于DedeCmsV5.3-5.6版本,需要修改幾處程序
RewriteRule ^(.*)/post\.html $1/post\.php [I]
RewriteRule ^(.*)/type\.html $1/type\.php [I]
RewriteRule ^(.*)/question-([0-9]+)\.html $1/question\.php\?id=$2 [I]
RewriteRule ^(.*)/browser-1-([0-9]+)\.html $1/browser\.php\?tid=$2 [I]
RewriteRule ^(.*)/browser-2-([0-9]+)\.html $1/browser\.php\?tid2=$2 [I]
RewriteRule ^(.*)/browser-1-([0-9]+)-([0-9]+)\.html $1/browser\.php\?tid=$2&page=$3 [I]
RewriteRule ^(.*)/browser-2-([0-9]+)-([0-9]+)\.html $1/browser\.php\?tid2=$2&page=$3 [I]
RewriteRule ^(.*)/browser-([0-9]+)\.html $1/browser\.php\?lm=$2 [I]
RewriteRule ^(.*)/browser-1-([0-9]+)-([0-9]+)\.html $1/browser\.php\?tid=$2&lm=$3 [I]
RewriteRule ^(.*)/browser-2-([0-9]+)-([0-9]+)\.html $1/browser\.php\?tid2=$2&lm=$3 [I]
2.Apache偽靜態(tài)

打開.htaccess文件,加入如下規(guī)則:

#提供部分規(guī)則作參考
RewriteEngine on
RewriteRule ^list-([0-9]+)\.html$ /plus/list.php?tid=$1
RewriteRule ^list-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /plus/list.php?tid=$1&totalresult=$2&PageNo=$3
RewriteRule ^view-([0-9]+)-1\.html$ /plus/view.php?arcID=$1
RewriteRule ^view-([0-9]+)-([0-9]+)\.html$ /plus/view.php?aid=$1&pageno=$2
RewriteRule ^index.html$ index.php

總結(jié)

1)以上提供的DedeCms偽靜態(tài)修改以及規(guī)則都是按照個(gè)人的修改步驟來的,僅供參考,你可以根據(jù)站點(diǎn)的實(shí)際情況作相應(yīng)調(diào)整;

2)偽靜態(tài)實(shí)現(xiàn)思路,即根據(jù)理想的URL結(jié)構(gòu)寫好偽靜態(tài)規(guī)則,然后對(duì)程序進(jìn)行相應(yīng)修改,并沒有你想象中的那么復(fù)雜;

3)不會(huì)程序、不會(huì)正則都沒有關(guān)系,但是思路一定要清晰,還有就是禁得住“折騰”,多研究,搞透了,對(duì)提升自己也有極大好處。

擴(kuò)展閱讀

1:DEDECMS Tag標(biāo)簽偽靜態(tài)規(guī)則在Apache中的實(shí)現(xiàn)方法

2:IIS7.5導(dǎo)入.htaccess偽靜態(tài)規(guī)則 URL重寫的方法教程

    轉(zhuǎn)載請(qǐng)注明來源網(wǎng)址:http://mengdiqiu.com.cn/dedecms_jq/1473.html

    發(fā)表評(píng)論

    評(píng)論列表(條)

       
      QQ在線咨詢
      VIP限時(shí)特惠