一级a爱做片无码免费手机在线_99久久精品视香蕉蕉aⅴ_在线一本到无码av_超碰在线观看不卡

九龍商務(wù)代辦主頁 > 網(wǎng)站建設(shè) > 站長學(xué)院 > 織夢dede > dedecms織夢全站偽靜態(tài)設(shè)置+全套偽靜態(tài)規(guī)則

dedecms織夢全站偽靜態(tài)設(shè)置+全套偽靜態(tài)規(guī)則

摘要:請確保你網(wǎng)站所在的主機或者服務(wù)器支持偽靜態(tài)并且已經(jīng)開啟了偽靜態(tài)功能! 本教程主要設(shè)置織夢偽靜態(tài)頁面包括有: 1.列表頁 /plus/list-2.html 2.列表頁分頁 /plus/list-2-26-2.html 3.內(nèi)容頁...

18978939080

立即咨詢

編輯: 來源: 發(fā)布日期:03-07 瀏覽量統(tǒng)計中... 反饋錯誤

  字體:細(xì)
請確保你網(wǎng)站所在的主機或者服務(wù)器支持偽靜態(tài)并且已經(jīng)開啟了偽靜態(tài)功能!
 
本教程主要設(shè)置織夢偽靜態(tài)頁面包括有:
1.列表頁 /plus/list-2.html
2.列表頁分頁 /plus/list-2-26-2.html
3.內(nèi)容頁 /plus/view-112-1.html
4.內(nèi)容頁分頁 /plus/view-112-2.html
5.TAG標(biāo)簽頁 /tags/織夢/
6.TAG標(biāo)簽分頁 /tags/織夢/2/
7.搜索頁 /search/織夢.html
8.搜索頁分頁 /search/織夢-2.html

網(wǎng)站后臺開啟偽靜態(tài)選項


網(wǎng)站后臺設(shè)置整站為動態(tài)

這里可以借助一個小插件來完成,一勞永逸
插件下載懶人包


網(wǎng)站文件修改
1、列表頁和內(nèi)容頁偽靜態(tài)鏈接
打開 \include\helpers\channelunit.helper.php 找到
  1. global $cfg_typedir_df;
改成
  1. global $cfg_typedir_df, $cfg_rewrite;
繼續(xù)找到
  1. $reurl = $GLOBALS['cfg_phpurl']."/list.php?tid=".$typeid;
改成
  1. if($cfg_rewrite == 'Y')
  2. {
  3.     $reurl = $GLOBALS["cfg_phpurl"]."/list-".$typeid.'.html';
  4. }
  5. else
  6. {
  7.     //動態(tài)
  8.     $reurl = $GLOBALS['cfg_phpurl']."/list.php?tid=".$typeid;
  9. }

2、手機版列表頁分頁不使用電腦版?zhèn)戊o態(tài)
打開 \include\arc.listview.class.php 找到
  1. if($cfg_rewrite == 'Y')
大概在1198行,把這一行改成
  1. if($cfg_rewrite == 'Y' && !defined('DEDEMOB'))

3、TAG標(biāo)簽偽靜態(tài)鏈接
打開 \include\taglib\tag.lib.php 找到
  1. $row['link'] = $cfg_cmsurl."/tags.php?/".urlencode($row['keyword'])."/";
改成
  1. $row['link'] = $cfg_cmsurl."/tags/".urlencode($row['keyword'])."/";

4、TAG標(biāo)簽分頁偽靜態(tài)鏈接
打開 \include\arc.taglist.class.php 找到
  1. $this->PageNo = $GLOBALS['PageNo'];
在它的下面加入
  1. if($this->PageNo == 0)
  2. {
  3.     $this->PageNo = 1;
  4. }
繼續(xù)找到
  1. $prepage="";
在它的上面加入
  1. global $cfg_rewrite;
繼續(xù)找到
  1. $purl .= "?/".urlencode($this->Tag);
改成
  1. if($cfg_rewrite == 'Y')
  2. {
  3.     $purl = "/tags/".urlencode($this->Tag);
  4. }
  5. else
  6. {
  7.     $purl .= "?/".urlencode($this->Tag);
  8. }

4、搜索頁偽靜態(tài)鏈接
打開 \plus\search.php 找到
  1. $t1 = ExecTime();
在它的下面加入
  1. $keyword = preg_replace("/-(\d+)/i",'',$keyword);
  2. $oldkeyword = preg_replace("/-(\d+)/i",'',$oldkeyword);
打開 \include\arc.searchview.class.php 找到
  1. global $oldkeyword;
改成
  1. global $oldkeyword, $cfg_rewrite;
繼續(xù)找到
  1. $purl .= "?".$geturl;
改成
  1. if($cfg_rewrite != 'Y' && !defined('DEDEMOB'))
  2. {
  3.     $purl .= "?".$geturl;
  4. }
  5. else
  6. {
  7.     $purl = '/search/'.urlencode($oldkeyword);
  8. }
繼續(xù)找到
  1. return $plist;
在它的上面加入
  1. if($cfg_rewrite == 'Y' && !defined('DEDEMOB'))
  2. {
  3.     $plist = preg_replace("/PageNo=(\d+)/i",'-\\1.html',$plist);
  4. }

最后還需要在你模板里搜索框代碼改成靜態(tài)的js提交搜索,參考下面代碼,注意紅框的地方
  1. <script type="text/javascript">
  2. function search()
  3. {
  4.     var q = document.getElementById("q").value;
  5.     window.location.href = "http://www.2l3.net/search/"+q+".html";
  6. }
  7. function enterIn(obj,evt)
  8. {
  9.     var evt = evt ? evt : (window.event ? window.event : null);
  10.     if (evt.keyCode == 13)
  11.     {
  12.         var q = obj.value;
  13.         window.location.href = "http://www.2l3.net/search/"+q+".html";
  14.     }
  15. }
  16. </script>
  17. <form action="" method="post" onsubmit="return false">
  18.     <div class="form">
  19.         <h4>搜索</h4>
  20.         <input name="q" id="q" onkeydown="enterIn(this,event);" type="text" />
  21.         <button type="submit" class="search-submit" onclick="search()">搜索</button>
  22.     </div>
  23. </form>

偽靜態(tài)規(guī)則
懶人包已經(jīng)打包了iis6、iis7、8、apache、nginx的規(guī)則文件
下面再寫一下各規(guī)則

iis6偽靜態(tài)規(guī)則 httpd.ini
  1. #列表頁和列表分頁
  2. RewriteRule ^(.*)/plus/list-([0-9]+)\.html $1/plus/list\.php\?tid=$2
  3. RewriteRule ^(.*)/plus/list-([0-9]+)-([0-9]+)-([0-9]+)\.html $1/plus/list\.php\?tid=$2&TotalResult=$3&PageNo=$4
  4. #內(nèi)容頁和內(nèi)容分頁
  5. RewriteRule ^(.*)/plus/view-([0-9]+)-([0-9]+)\.html $1/plus/view\.php\?arcID=$2&pageno=$3
  6. #TAG標(biāo)簽偽靜態(tài)規(guī)則
  7. RewriteRule ^(.*)/tags\.html $1/tags\.php [I]
  8. RewriteRule ^(.*)/tags/(.*)(?:(\?.*))* $1/tags\.php\?\/$2 [I]
  9. RewriteRule ^(.*)/tags/(.*)\/(?:(\?.*))* $1/tags\.php\?\/$2\/ [I]
  10. RewriteRule ^(.*)/tags/(.*)\/([0-9])(?:(\?.*))* $1/tags\.php\?\/$2\/$3 [I]
  11. RewriteRule ^(.*)/tags/(.*)\/([0-9])\/(?:(\?.*))* $1/tags\.php\?\/$2\/$3\/ [I]
  12. #搜索頁
  13. RewriteRule ^(.*)/search/(.*)-([0-9]+)\.html  $1/plus/search.php?q=$2&PageNo=$3&pagesize=2&searchtype=title
  14. RewriteRule ^(.*)/search/(.*)\.html  $1/plus/search.php?q=$2&pagesize=2&searchtype=title

iis7、8偽靜態(tài)規(guī)則 web.config
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration>
  3.     <system.webServer>
  4.         <rewrite>
  5.             <rules>
  6.                 <rule name="首頁">
  7.                     <match url="^index.html$" ignoreCase="false" />
  8.                     <action type="Rewrite" url="index.php" appendQueryString="false" />
  9.                 </rule>
  10.                 <rule name="列表">
  11.                     <match url="^plus/list-([0-9]+).html$" ignoreCase="false" />
  12.                     <action type="Rewrite" url="/plus/list.php?tid={R:1}" appendQueryString="false" />
  13.                 </rule>
  14.                 <rule name="列表分頁">
  15.                     <match url="^plus/list-([0-9]+)-([0-9]+)-([0-9]+).html$" ignoreCase="false" />
  16.                     <action type="Rewrite" url="/plus/list.php?tid={R:1}&amp;totalresult={R:2}&amp;PageNo={R:3}" appendQueryString="false" />
  17.                 </rule>
  18.                 <rule name="文章分頁">
  19.                     <match url="^plus/view-([0-9]+)-([0-9]+).html$" ignoreCase="false" />
  20.                     <action type="Rewrite" url="/plus/view.php?aid={R:1}&amp;pageno={R:2}" appendQueryString="false" />
  21.                 </rule>
  22. <rule name="tag首頁">
  23. <match url="^tags.html$" ignoreCase="false" />
  24. <action type="Rewrite" url="tags.php" appendQueryString="false" />
  25. </rule>
  26. <rule name="tag列表">
  27. <match url="^tags/(.*)(?:(\?.*))*$" ignoreCase="false" />
  28. <action type="Rewrite" url="/tags.php?/{R:1}" appendQueryString="false" />
  29. </rule>
  30. <rule name="tag列表最后有左斜杠">
  31. <match url="^tags/(.*)/(?:(\?.*))*$" ignoreCase="false" />
  32. <action type="Rewrite" url="/tags.php?/{R:1}/" appendQueryString="false" />
  33. </rule>
  34. <rule name="tag列表分頁">
  35. <match url="^tags/(.*)/([0-9])(?:(\?.*))*$" ignoreCase="false" />
  36. <action type="Rewrite" url="/tags.php?/{R:1}/{R:2}" appendQueryString="false" />
  37. </rule>
  38. <rule name="tag列表分頁最后有左斜杠">
  39. <match url="^tags/(.*)/([0-9])/(?:(\?.*))*$" ignoreCase="false" />
  40. <action type="Rewrite" url="/tags.php?/{R:1}/{R:2}/" appendQueryString="false" />
  41. </rule>
  42. <rule name="搜索頁分頁">
  43.                     <match url="^search/(.*)-([0-9]+).html$" ignoreCase="false" />
  44.                     <action type="Rewrite" url="/plus/search.php?q={R:1}&amp;PageNo={R:2}&amp;pagesize=2&amp;searchtype=title" appendQueryString="false" />
  45.                 </rule>
  46. <rule name="搜索頁">
  47.                     <match url="^search/(.*).html$" ignoreCase="false" />
  48.                     <action type="Rewrite" url="/plus/search.php?q={R:1}&amp;pagesize=2&amp;searchtype=title" appendQueryString="false" />
  49.                 </rule>
  50.             </rules>
  51.         </rewrite>
  52.     </system.webServer>
  53. </configuration>

apache偽靜態(tài)規(guī)則 .htaccess
  1. #列表頁和列表分頁
  2. RewriteRule ^plus/list-([0-9]+)\.html$ plus/list.php?tid=$1
  3. RewriteRule ^plus/list-([0-9]+)-([0-9]+)-([0-9]+)\.html$ plus/list.php?tid=$1&TotalResult=$2&PageNo=$3      
  4. #內(nèi)容頁和內(nèi)容分頁
  5. RewriteRule ^plus/view-([0-9]+)-([0-9]+)\.html$ plus/view.php?arcID=$1&pageno=$2
  6. #TAG標(biāo)簽
  7. RewriteRule ^tags\.html$ tags\.php
  8. RewriteRule ^tags/(.*)(?:(\?.*))* tags\.php\?\/$1
  9. RewriteRule ^tags/(.*)\/(?:(\?.*))*  tags\.php\?\/$1\/
  10. RewriteRule ^tags/(.*)\/([0-9])(?:(\?.*))* tags\.php\?\/$1\/$2
  11. RewriteRule ^tags/(.*)\/([0-9])\/(?:(\?.*))*  tags\.php\?\/$1\/$2\/
  12. #搜索頁
  13. RewriteRule ^search/(.*)-([0-9]+)\.html$  plus/search.php?q=$1&PageNo=$2&pagesize=2&searchtype=title
  14. RewriteRule ^search/(.*)\.html$  plus/search.php?q=$1&pagesize=2&searchtype=title

nginx偽靜態(tài)規(guī)則
  1. rewrite ^/plus/list-([0-9]+)\.html$ /plus/list.php?tid=$1;
  2. rewrite ^/plus/list-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /plus/list.php?tid=$1&totalresult=$2&PageNo=$3;
  3. rewrite ^/plus/view-([0-9]+)-1\.html$ /plus/view.php?arcID=$1;
  4. rewrite ^/plus/view-([0-9]+)-([0-9]+)\.html$ /plus/view.php?aid=$1&pageno=$2;
  5. rewrite ^/tags\.html$ /tags.php;
  6. rewrite ^/tags/(.*)(?:(\?.*))* /tags.php?/$1;
  7. rewrite ^/tags/(.*)/(?:(\?.*))*  /tags.php?/$1/;
  8. rewrite ^/tags/(.*)/([0-9])(?:(\?.*))* /tags.php?/$1/$2;
  9. rewrite ^/tags/(.*)/([0-9])/(?:(\?.*))*  /tags.php?/$1/$2/;
  10. rewrite ^/search/(.*)-([0-9]+)\.html$  /plus/search.php?q=$1&PageNo=$2&pagesize=2&searchtype=title;
  11. rewrite ^/search/(.*)\.html$  /plus/search.php?q=$1&pagesize=2&searchtype=title;
提取密碼:jg2y

    更多相關(guān)閱讀

【九龍商務(wù)代辦】微信號

官方微信公眾號

24小時電話18978939080

民族大道49號民族宮B座2306號(新夢之島樓上)

工商注冊13807817411
其他業(yè)務(wù)13878807671
?
【九龍商務(wù)代辦】QQ
QQ在線咨詢
客服咨詢
【九龍商務(wù)代辦】QQ
【九龍商務(wù)代辦】QQ
【九龍商務(wù)代辦】QQ
【九龍商務(wù)代辦】QQ
咨詢熱線
18978939080
13807817411
13878807671
0771-5537667

反饋
【九龍商務(wù)代辦】微信號掃描二維碼關(guān)注我為好友
瀏覽: