VPS参考测评推荐
专注分享VPS主机优惠信息
衡天云优惠活动
华纳云最新优惠促销活动
jtti最新优惠促销活动

phpcms手机站首页如何设置伪静态?(discuz手机伪静态)

locvps
主机参考:VPS测评参考推荐/专注分享VPS服务器优惠信息!若您是商家可以在本站进行投稿,查看详情!此外我们还提供软文收录、PayPal代付、广告赞助等服务,查看详情!
我们发布的部分优惠活动文章可能存在时效性,购买时建议在本站搜索商家名称可查看相关文章充分了解该商家!若非中文页面可使用Edge浏览器同步翻译!PayPal代付/收录合作

phpcms手机站首页如何设置伪静态?(discuz手机伪静态)

phpcms手机站首页如何设置伪静态

phpcms移动台主页设置伪静态的方法:

1.打开/PHP CMS/modules/WAP/functions/global . func . PHP

找到里面的两个函数,如下图所示,并在下面添加一行代码。

函数列表URL($ typeid){ # return WAP _ SITEURL。”& a = lists & typeid = $ typeid“;返回“/list-$typeid“。'。html & # 39;}函数show _ URL($ catid,$id,$ typeid = & # 39'){ global $ WAPif($ typeid = = & # 39;'){ $ types = get cache(& # 39;wap _ type & # 39,'wap & # 39);foreach($ types as $ type){ if($ type【& # 39;猫& # 39;】= = $ catid){ $ typeid = $ type【& # 39;typeid & # 39];打破;} }} #return WAP_SITEURL。“& a = show & catid = $ catid & typeid = $ typeid & id = $ id“;return“/show-$ catid-$ typeid-$ id-1”。'。html & # 39;}2.打开/phpcms/modules/WAP/index.php

找到第59行,如下图所示,并在下面添加一行代码。

# define(& # 39;URLRULE & # 39, 'index.php吗?m = WAP & c = index & a = lists & typeid = { $ typeid } ~ index . PHP?m = WAP & c = index & a = lists & typeid = { $ typeid } & page = { $ page } & # 39;);定义(& # 39;URLRULE & # 39, '列表-{$typeid}。html~list-{$typeid}-{$page}。html & # 39);3.添加伪静态规则。

我用的是apache服务器,设置apache服务器支持。htaccess文件,创建htaccess文件,并在其中添加代码:

重写引擎打开

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

这样,phpcms手机站就变成了伪静态。

如何设置和创建。htaccess可以是百度自己的,方法比较简单,这里就不细说了。

如果是nginx服务器,重写规则如下所示:

重写^/list-([0-9]+).html /index.php?& a = lists & typeid = $ 1 last重写^/show-([0-9]+)-([0-9]+)-([0-9]+)-1.html/index . PHP?a = show & catid = $ 1 & typeid = $ 2 & id = $ 3 last;推荐教程:phpcms教程

以上就是如何在phpcms手机站首页设置伪静态。更多详情请关注主机参考其他相关文章!

这几篇文章你可能也喜欢:

本文由主机参考刊发,转载请注明:phpcms手机站首页如何设置伪静态?(discuz手机伪静态) https://zhujicankao.com/102418.html

【腾讯云】领8888元采购礼包,抢爆款云服务器 每月 9元起,个人开发者加享折上折!
打赏
转载请注明原文链接:主机参考 » phpcms手机站首页如何设置伪静态?(discuz手机伪静态)
主机参考仅做资料收集,不对商家任何信息及交易做信用担保,购买前请注意风险,有交易纠纷请自行解决!请查阅:特别声明

评论 抢沙发

评论前必须登录!