国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > PhpCMS > 正文

PHPCMS手機站偽靜態(tài)設置詳細教程

2024-09-10 07:16:26
字體:
來源:轉載
供稿:網友

1、打開/phpcms/modules/wap/functions/global.func.php

找到里面的這兩個函數(shù),如下圖所示的注釋掉的那行代碼,在下面加入一行代碼。

  1. functionlist_url($typeid) { 
  2.   #returnWAP_SITEURL."&a=lists&typeid=$typeid"
  3.   return"/list-$typeid".'.html' 
  4. functionshow_url($catid,$id,$typeid='') { 
  5. global$WAP
  6. if($typeid=='') { 
  7.  $types= getcache('wap_type','wap'); 
  8.  <a href="/tags.php/foreach/" target="_blank">foreach</a>($typesas$type) { 
  9.   if($type['cat']==$catid) { 
  10.   $typeid=$type['typeid']; 
  11.   break
  12.   } 
  13.  } 
  14. }  
  15.   #returnWAP_SITEURL."&a=show&catid=$catid&typeid=$typeid&id=$id"
  16.   return"/show-$catid-$typeid-$id-1".'.html' 

2、打開/phpcms/modules/wap/index.php

找到第59行,如下圖所示的注釋掉的那行代碼,在下面加入一行代碼。

  1. #define('URLRULE','index.php?m=wap&c=index&a=lists&typeid={$typeid}~index.php?m=wap&c=index&a=lists&typeid={$typeid}&page={$page}'); 
  2. define('URLRULE','list-{$typeid}.html~list-{$typeid}-{$page}.html'); 
3、添加偽靜態(tài)規(guī)則

我使用的是apache服務器,把apache服務器設置支持.htaccess文件,在網站根目錄創(chuàng)建.htaccess文件,在里面添加代碼:

  1. RewriteEngine On  
  2. RewriteRule ^list-([0-9]+)-([0-9]+) index.php?&a=lists&typeid=$1&page=$2 
  3. RewriteRule ^list-([0-9]+) index.php?&a=lists&typeid=$1
  4. RewriteRule ^show-([0-9]+)-([0-9]+)-([0-9]+) index.php?a=show&catid=$1&typeid=$2&id=$3
這樣,phpcms手機站就變成偽靜態(tài)了。
 
.htaccess如何設置和創(chuàng)建可自行百度一下,方法都比較簡單,這里就不細說了。

如果是nginx服務器,重寫規(guī)則這樣寫:

  1. rewrite ^/list-([0-9]+).html /index.php?&a=lists&typeid=$1last
  2. rewrite ^/show-([0-9]+)-([0-9]+)-([0-9]+)-1.html /index.php?a=show&catid=$1&typeid=$2&id=$3last

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 金寨县| 峨山| 凌海市| 兴国县| 班玛县| 西吉县| 桦川县| 泽库县| 临夏县| 随州市| 磐安县| 嘉禾县| 文化| 连云港市| 平江县| 玛曲县| 武定县| 连南| 文安县| 富裕县| 长丰县| 武夷山市| 绥宁县| 灵石县| 昌平区| 社会| 利津县| 衡山县| 安西县| 汕尾市| 滦南县| 遂平县| 闽侯县| 博湖县| 页游| 临泽县| 武定县| 兴安县| 永泰县| 玛纳斯县| 绥芬河市|