phpcms在nginx的rewrite伪静态标准写法

phpcms在nginx的rewrite伪静态标准写法,第1张

phpcms在nginx的rewrite伪静态标准写法

Phpcms是用nginx的重写伪静态写的,但是网上一片混乱。不知道有多少种。有些是直接从apache标准修改过来的,但是这些修改并不是最标准的。

我用的ss="superseo">ss="superseo">lnmp一键安装包,conf文档是放到默认设置途径。在开展检测时,我先应用了

复制代码编码以下:
location/{
rewrite^/caipu-([0-9])-([0-9])-([0-9]).html/index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3last;
rewrite^/content-([0-9])-([0-9])-([0-9]).html/index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3last;
rewrite^/list-([0-9])-([0-9]).html/index.php?m=content&c=index&a=lists&catid=$1&page=$2last;
rewrite^/tag-([^\.]*)-([0-9])-([0-9]).html/index.php?m=content&c=tag&catid=$2&tag=$1&page=$3last;
rewrite^/comment-([0-9])-([0-9])-([0-9]).html/index.php?m=comment&c=index&a=init&commentid=content_$1-$2-$3last;
rewrite^/([^\.]*).html/index.php?m=member&c=index&a=$1last;
}

随后就出現餐具了。开启首页时提醒“Actiondoesnotexist.”意思是个人行为不会有?我翻边了百度搜索,在phpcms官方论坛有些人说这一不正确是详细地址难题,再想到到我是修改伪静态出現的······我明白了,是主页伪静态难题!

在我对比了wordpress官方网的写法后,我TM总算写出了。。。

复制代码编码以下:
location/{
if(!-f$request_filename){
rewrite(.*)/index.php;
}
rewrite^/caipu-([0-9])-([0-9])-([0-9]).html/index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3last;
rewrite^/content-([0-9])-([0-9])-([0-9]).html/index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3last;
rewrite^/list-([0-9])-([0-9]).html/index.php?m=content&c=index&a=lists&catid=$1&page=$2last;
rewrite^/tag-([^\.]*)-([0-9])-([0-9]).html/index.php?m=content&c=tag&catid=$2&tag=$1&page=$3last;
rewrite^/comment-([0-9])-([0-9])-([0-9]).html/index.php?m=comment&c=index&a=init&commentid=content_$1-$2-$3last;
rewrite^/([^\.]*).html/index.php?m=member&c=index&a=$1last;
}

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/zz/773052.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-03
下一篇 2022-05-03

发表评论

登录后才能评论

评论列表(0条)

保存