PHPCMS手機站偽靜態設定

2021-07-26 14:50:25 字數 1267 閱讀 5835

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

找到裡面的這兩個函式,如下圖所示的注釋掉的那行**,在下面加入一行**。

function list_url($typeid) 

function show_url($catid, $id, $typeid='')

}}

#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=~index.php?m=wap&c=index&a=lists&typeid=&page=');

define('urlrule', 'list-.html~list--.html');

3、新增偽靜態規則

我使用的是apache伺服器,把apache伺服器設定支援.htaccess檔案,在**根目錄建立.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手機站就變成偽靜態了。

如果是nginx伺服器,重寫規則這樣寫:

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手機站偽靜態設定詳細教程

1 開啟 phpcms modules wap functions global.func.php 找到裡面的這兩個函式,如下圖所示的注釋掉的那行 在下面加入一行 function list url typeid function show url catid,id,typeid return wa...

PHPCMS手機站偽靜態設定詳細教程

1 開啟 phpcms modules wap functions global.func.php 找到裡面的這兩個函式,如下圖所示的注釋掉的那行 在下面加入一行 function list url typeid function show url catid,id,typeid return wa...

phpcms 手機站搭建

相關標籤 標題 調取欄目鏈結 調取詳細資訊 無法調取單頁面的解決方法!當前的phpcms v9手機 的設定還有點弱,繫結的欄目不能設定選擇模板,而且不能繫結單頁面page。不過可以自定義做到繫結單頁面page這乙個功能 1 修改phpcms modules wap index.php,新增 func...