1、打開(kāi)/phpcms/modules/wap/functions/global.func.php
找到里面的這兩個(gè)函數(shù),如下圖所示的注釋掉的那行代碼,在下面加入一行代碼。
- functionlist_url($typeid) {
- #returnWAP_SITEURL."&a=lists&typeid=$typeid";
- return"/list-$typeid".'.html'
- }
- functionshow_url($catid,$id,$typeid='') {
- global$WAP;
- if($typeid=='') {
- $types= getcache('wap_type','wap');
- <a href="/tags.php/foreach/" target="_blank">foreach</a>($typesas$type) {
- if($type['cat']==$catid) {
- $typeid=$type['typeid'];
- break;
- }
- }
- }
- #returnWAP_SITEURL."&a=show&catid=$catid&typeid=$typeid&id=$id";
- return"/show-$catid-$typeid-$id-1".'.html'
- }
2、打開(kāi)/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');
我使用的是apache服務(wù)器,把a(bǔ)pache服務(wù)器設(shè)置支持.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;
如果是nginx服務(wù)器,重寫(xiě)規(guī)則這樣寫(xiě):
- rewrite ^/list-([0-9]+).html /index.php?&a=lists&typeid=$1last;
- rewrite ^/show-([0-9]+)-([0-9]+)-([0-9]+)-1.html /index.php?a=show&catid=$1&typeid=$2&id=$3last;
新聞熱點(diǎn)
疑難解答
圖片精選