如何正确的设置云优cms伪静态规则?

2022-04-13 0 701

多小伙伴因为使用场景的问题,导致安装了云优CMS却无法使用静态模式,那么本篇文章结合具体使用场景为您介绍如何正确设置静态。根据使用场景我们可以分为服务器安装和空间安装云优CMS。

我们以宝塔面板作为示例说明

查看自己安装的环境,左侧软件商店,如下图红框所示,证明您已经安装好了apache环境,apache环境对于新手用户是比较友好的,无需任何设置,只要站点根目录存在.htaccess静态文件就直接生效
如何正确的设置云优cms伪静态规则?

如果您安装的环境是nginx,那么需要左侧点击【网站】-【设置】-【静态】,将下面提供的nginx静态规则复制进去就可以了
如何正确的设置云优cms伪静态规则?

if (!-d $request_filename){
set $rule_0 1$rule_0;
}
if (!-f $request_filename){
set $rule_0 2$rule_0;
}
if ($rule_0 = "21"){
rewrite ^/(.*)\.(asp|aspx|asa|asax|dll|jsp|cgi|fcgi|pl)(.*)$ /404.htm;
}
rewrite ^/admin/(.*).html$ /index.php?s=admin/$1 last;
rewrite ^/admin/(.*)$ /index.php?s=admin/$1 last;
rewrite ^/config/(.*)$ /404.htm last;
rewrite ^/statics/ueditor/dialogs/(.*)/(.*).html$ /statics/ueditor/dialogs/$1/$2.html last;
rewrite ^/m/$ /index.php?s=wap/index/index last;
rewrite ^/m/search/$ /index.php?s=wap/search/index last;
rewrite ^/m/myform/$ /index.php?s=wap/myform/index last;
rewrite ^/m/captcha/(\d*)$ /index.php?s=wap/myform/captcha&id=$1 last;
rewrite ^/m/(.*)_search/$ /index.php?s=wap/search/index&area=$1 last;
rewrite ^/m/(.*)_tag/([\s\S]*)$ /index.php?s=wap/tag/index&title=$2&area=$1 last;
rewrite ^/m/tag/([\s\S]*)$ /index.php?s=wap/tag/index&title=$1 last;
rewrite ^/m/(.*)/(.*)_(.*)/(.*)_(.*).html$ /index.php?s=wap/show/index&etitle=$4&ctitle=$1/$3&area=$2&cw=$5 last;
rewrite ^/m/(.*)_(.*)/(.*)_(.*).html$ /index.php?s=wap/show/index&etitle=$3&ctitle=$2&area=$1&cw=$4 last;
rewrite ^/m/(.*)/(.*)_(.*)/(.*).html$ /index.php?s=wap/show/index&etitle=$4&ctitle=$1/$3&area=$2 last;
rewrite ^/m/(.*)_(.*)/(.*).html$ /index.php?s=wap/show/index&etitle=$3&ctitle=$2&area=$1 last;
rewrite ^/m/(.*)/(.*)_(.*).html$ /index.php?s=wap/show/index&etitle=$2&ctitle=$1&cw=$3 last;
rewrite ^/m/(.*)/(.*).html$ /index.php?s=wap/show/index&etitle=$2&ctitle=$1 last;
rewrite ^/m/(.*)/(.*)_(.*)/$ /index.php?s=wap/category/index&ctitle=$1/$3&area=$2 last;
rewrite ^/m/(.*)_(.*)/$ /index.php?s=wap/category/index&ctitle=$2&area=$1 last;
rewrite ^/m/(.*)/(.*)_(.*)/page/(\d*)$ /index.php?s=wap/category/index&ctitle=$1/$3&area=$2&page=$4 last;
rewrite ^/m/(.*)_(.*)/page/(\d*)$ /index.php?s=wap/category/index&ctitle=$2&area=$1&page=$3 last;
rewrite ^/m/(.*)/$ /index.php?s=wap/category/index&ctitle=$1 last;
rewrite ^/m/(.*)/page/(\d*)$ /index.php?s=wap/category/index&ctitle=$1&page=$2 last;
rewrite ^/m/(.*).html$ /index.php?s=wap/index/index&area=$1 last;
rewrite ^/index(.*)/$ /index.php?s=index/index/index/$1 last;
rewrite ^/myform/$ /index.php?s=index/myform/index last;
rewrite ^/(.*)_myform/$ /index.php?s=index/myform/index&area=$1 last;
rewrite ^/captcha/(\d*)$ /index.php?s=index/myform/captcha&id=$1 last;
rewrite ^/(.*)_captcha/(\d*)$ /index.php?s=index/myform/captcha&area=$1&id=$2 last;
rewrite ^/search/$ /index.php?s=index/search/index last;
rewrite ^/search/page/(\d*)$ /index.php?s=index/search/index&page=$1 last;
rewrite ^/(.*)_search/$ /index.php?s=index/search/index&area=$1 last;
rewrite ^/(.*)_tag/([\s\S]*)$ /index.php?s=index/tag/index&title=$2&area=$1 last;
rewrite ^/tag/([\s\S]*)$ /index.php?s=index/tag/index&title=$1 last;
rewrite ^/(.*)/(.*)_(.*)/(.*)_(.*).html$ /index.php?s=index/show/index&etitle=$4&ctitle=$1/$3&area=$2&cw=$5 last;
rewrite ^/(.*)_(.*)/(.*)_(.*).html$ /index.php?s=index/show/index&etitle=$3&ctitle=$2&area=$1&cw=$4 last;
rewrite ^/(.*)/(.*)_(.*)/(.*).html$ /index.php?s=index/show/index&etitle=$4&ctitle=$1/$3&area=$2 last;
rewrite ^/(.*)_(.*)/(.*).html$ /index.php?s=index/show/index&etitle=$3&ctitle=$2&area=$1 last;
rewrite ^/(.*)/(.*)_(.*).html$ /index.php?s=index/show/index&etitle=$2&ctitle=$1&cw=$3 last;
rewrite ^/(.*)/(.*).html$ /index.php?s=index/show/index&etitle=$2&ctitle=$1 last;
rewrite ^/(.*)/(.*)_(.*)/$ /index.php?s=index/category/index&ctitle=$1/$3&area=$2 last;
rewrite ^/(.*)_(.*)/$ /index.php?s=index/category/index&ctitle=$2&area=$1 last;
rewrite ^/(.*)/(.*)_(.*)/page/(\d*)$ /index.php?s=index/category/index&ctitle=$1/$3&area=$2&page=$4 last;
rewrite ^/(.*)_(.*)/page/(\d*)$ /index.php?s=index/category/index&ctitle=$2&area=$1&page=$3 last;
rewrite ^/(.*)/$ /index.php?s=index/category/index&ctitle=$1 last;
rewrite ^/(.*)/page/(\d*)$ /index.php?s=index/category/index&ctitle=$1&page=$2 last;
rewrite ^/(.*).html$ /index.php?s=index/index/index&area=$1 last;

空间安装一般注意要点如下
1)php版本需要5.4~7.3,有些空间是默认是5.2需要进行设置
2)检查空间的环境
apache环境:一般无需设置,程序自带的.htaccess就可以适配
nginx环境:和宝塔面板类似方式,在空间里找到静态设置项,把静态规则拷贝进去
附特殊主机设置教程
http://www.yunucms.com/technology/360.html
http://www.yunucms.com/technology/411.html
IIS环境:如果web.config不生效则需要联系空间商协助导入静态规则

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

所有文章为演示数据,不提供下载地址,版权归原作者所有,仅提供演示效果!

智云谷资源共享网站 CMS教程与问题 如何正确的设置云优cms伪静态规则? https://www.zhiyungu.cn/cmsjiaocheng/2488.html

我们只做高端Wordpress主题开发!

常见问题
  • 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。
查看详情
  • 最常见的情况是下载不完整: 可对比下载完压缩包的与网盘上的容量,若小于网盘提示的容量则是这个原因。这是浏览器下载的bug,建议用
查看详情

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务