亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

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

 更新時間:2017年02月06日 11:11:35   作者:szk2021  
這篇文章主要介紹了PHPCMS手機站偽靜態(tài)設置教程,非常不錯,具有參考借鑒價值,需要的朋友可以參考下

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

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

function list_url($typeid) { 
  #return WAP_SITEURL."&a=lists&typeid=$typeid"; 
  return "/list-$typeid".'.html'; 
} 
function show_url($catid, $id, $typeid='') { 
global $WAP; 
if($typeid=='') { 
 $types = getcache('wap_type','wap'); 
 foreach ($types as $type) { 
  if($type['cat']==$catid) { 
  $typeid = $type['typeid']; 
  break; 
  } 
 } 
}  
  #return WAP_SITEURL."&a=show&catid=$catid&typeid=$typeid&id=$id"; 
  return "/show-$catid-$typeid-$id-1".'.html'; 
}

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

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

#define('URLRULE', 'index.php?m=wap&c=index&a=lists&typeid={$typeid}~index.php?m=wap&c=index&a=lists&typeid={$typeid}&page={$page}'); 
define('URLRULE', 'list-{$typeid}.html~list-{$typeid}-{$page}.html'); 

3、添加偽靜態(tài)規(guī)則

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

RewriteEngine On  

RewriteRule ^list-([0-9]+)-([0-9]+) index.php?&a=lists&typeid=$1&page=$2 
RewriteRule ^list-([0-9]+) index.php?&a=lists&typeid=$1; 
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ī)則這樣寫:

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

以上所述是小編給大家介紹的PHPCMS手機站偽靜態(tài)設置),希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評論