PHP群:95885625 Hbuilder+MUI群:81989597 站长QQ:634381967
    您现在的位置: 首页 > CMS教程 > phpcms教程 > 正文

    PHPCMS v9手机伪静态方法

    作者:admin来源:网络浏览:时间:2020-09-30 00:07:50我要评论
    导读:群里很多朋友问到phpcms v9手机站如何伪静态,今天B5教程网分享一下教程给大家,希望对大家有所帮助。1、打开/phpcms/modules/wap/functio...
    群里很多朋友问到phpcms v9手机站如何伪静态,今天B5教程网分享一下教程给大家,希望对大家有所帮助。

    1、打开/phpcms/modules/wap/functions/global.func.php
    找到里面的这两个函数,如下图所示的注释掉的那行代码,在下面加入一行代码。

    1. function list_url($typeid) { 
    2.     #return WAP_SITEURL."&a=lists&typeid=$typeid"; 
    3.     return "/list-$typeid".'.html'
    4.  
    5.  
    6.  
    7. function show_url($catid, $id, $typeid='') { 
    8. global $WAP; 
    9. if($typeid=='') { 
    10.   $types = getcache('wap_type','wap'); 
    11.   foreach ($types as $type) { 
    12.    if($type['cat']==$catid) { 
    13.     $typeid = $type['typeid']; 
    14.     break
    15.    } 
    16.   } 
    17. }   
    18.     #return WAP_SITEURL."&a=show&catid=$catid&typeid=$typeid&id=$id"; 
    19.     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.  
    3. define('URLRULE''list-{$typeid}.html~list-{$typeid}-{$page}.html'); 

    3、添加伪静态规则,打开根目录的权限文件,添加如下代码

     

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

     

    转载请注明(B5教程网)原文链接:https://b5.mxunkeji.com/content-101-5324-1.html
    相关热词搜索: phpcms 伪静态