2核1G3M服务器88一季度

腾讯云,阿里云百度云等 折扣价→点我←

苹果cms伪静态配置出错及伪静态弹出下载解决方法 苹果cms v10 教程

曹蛋烈 四级用户组

苹果cms伪静态配置出错及伪静态弹出下载解决方法

首先,苹果cms的伪静态在宝塔面板 特别是linux环境下,配置好伪静态后,点击链接可能会弹出下载框。

这个解决方法我们等下再说,我们先谈谈苹果cms的伪静态

linux服务器或者vps下的伪静态规则可以直接在宝塔面板选择

规则如下

location /{	rewrite ^/vod-(.*)$ /index.php?m=vod-$1 break;	rewrite ^/art-(.*)$ /index.php?m=art-$1 break;	rewrite ^/gbook-(.*)$ /index.php?m=gbook-$1 break;	rewrite ^/label-(.*)$ /index.php?m=label-$1 break;	rewrite ^/map-(.*)$ /index.php?m=map-$1 break;}

然后你就会发现按照默认的伪静态配置可能会弹出下载链接,其实解决方法很简单

你去需要去掉location /{和}就可以完美解决了。

说完出错的解决方法 我们来谈谈苹果cms自定义伪静态页面路径的方法

再谈路径之前我们先看看官方的动态路径

视频地图页 index.php?m=vod-map.html视频栏目页 index.php?m=vod-type-id-*-pg-*.html视频内容页 index.php?m=vod-detail-id-*.html视频播放页 index.php?m=vod-play-id-*-src-*-num-*.html视频搜索页 index.php?m=vod-search-wd-*-pg-*.html视频专题首页 index.php?m=vod-topicindex-pg-*.html视频专题列表 index.php?m=vod-topic-id-*-pg-*.html 文章地图页 index.php?m=art-map.html文章栏目页 index.php?m=art-type-id-*-pg-*.html文章内容页 index.php?m=art-detail-id-*-pg-*.html文章搜索页 index.php?m=art-search-wd-*-pg-*.html文章专题首页 index.php?m=art-topicindex-pg-*.html文章专题列表 index.php?m=art-topic-id-*-pg-*.html  视频筛选页 index.php?m=vod-list-id-*-pg-*-wd-*-area-*-lang-*-year-*-letter-*-order-*-by-*.html文章筛选页 index.php?m=art-list-id-*-pg-*-wd-*-letter-*-order-*-by-*.html 视频tag页 index.php?m=vod-search-tag-*-pg-*.html新闻tag页 index.php?m=art-search-tag-*-pg-*.html 留言本 index.php?m=gbook-show.html地图页 index.php?m=map-*-pg-*.html自定义页面 index.php?m=label-*-pg-*.html


其实配置很简单,例如

rewrite ^/vod-(.*)$ /index.php?m=vod-$1 break;

前段对应的是后台的url伪静态样式: 每一个(.*)  代码后台的一个变量 
后段对应的原始访问地址:  按顺序来接收变量 $1  $2  $3  。。。。
切记写规则的时候,如果2个规则相近都满足规则条件的话, 谁在上面,先执行谁。

下面举个简单的例子
我们要将动态页面
http://shepidy.com/?m=vod-detail-id-5.html
改成伪静态页面为
http://shepidy.com/shenqi/5.html

 

 那么规则就是

rewrite ^/shenqi/(.*)$ /index.php?m=vod-detail-id-$1 break;

下面是其他代码

rewrite ^/play/(.*)-(.*)-(.*)$ /index.php?m=vod-play-id-$1-src-$2-num-$3 break;	rewrite ^/list/(.*)-p-(.*)-(.*)$ /index.php?m=vod-type-id-$1 break;	rewrite ^/vod-(.*)$ /index.php?m=vod-$1 break;	rewrite ^/art-(.*)$ /index.php?m=art-$1 break;	rewrite ^/gbook-(.*)$ /index.php?m=gbook-$1 break;	rewrite ^/label-(.*)$ /index.php?m=label-$1 break;	rewrite ^/map-(.*)$ /index.php?m=map-$1 break;

最后在后台按照自己设定的规则配置路径就可以了。

站长窝论坛版权声明 1、本帖标题:苹果cms伪静态配置出错及伪静态弹出下载解决方法
2、论坛网址:站长窝论坛
3、站长窝论坛的资源部分来源于网络,如有侵权,请联系站长进行删除处理。
4、会员发帖仅代表会员个人观点,并不代表本站赞同其观点和对其真实性负责。
5、站长窝论坛一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
6、本帖由曹蛋烈在站长窝论坛《站长交流》版块原创发布, 转载请注明出处!
评论
最新回复 (1)
返回
发新帖