苹果CMSV10最新伪静态规则

发布时间:2024-08-28共12人阅读

苹果CMS V10伪静态规则说明

苹果CMS V10 网站开启伪静态后,可以将默认的动态 URL 转换成更加简洁的路径形式,例如将视频详情页、播放页、分类页、搜索页等地址进行统一重写。

对于使用苹果CMS V10 搭建影视网站的站长来说,伪静态属于比较重要的服务器配置。不同 Web 服务器使用的规则文件并不完全相同,常见的包括 .htaccesshttpd.inimaccms.confweb.config

本文整理苹果CMS V10 常见伪静态 URL 结构以及对应规则,方便根据自己的服务器环境选择和配置。

苹果CMS伪静态规则

苹果CMS V10伪静态有什么作用

苹果CMS 默认页面需要通过程序参数识别当前访问的模块,例如视频分类、视频详情、播放页面等。配置伪静态后,可以把这些动态参数映射成比较直观的 URL。

例如视频详情页可以使用:

detail/123

视频播放页则可以使用:

play/123-1-1

这样既方便用户理解 URL 结构,也便于网站统一规划链接格式。需要注意的是,伪静态本身并不等于 SEO 优化,实际搜索表现还与页面内容、链接结构、网站质量、抓取情况等因素有关。

苹果CMS V10伪静态URL规则对照表

下面是常见页面与伪静态路径之间的对应关系:

页面类型伪静态规则
视频地图页map
视频分类页type/{id}-{pg}
视频内容页detail/{id}
视频播放页play/{id}-{src}-{num}
视频下载页down/{id}-{src}-{num}
视频筛选页vod-list-id-{id}-pg-{pg}-order-{order}-by-{by}-class-{class}-year-{year}-letter-{letter}-area-{area}-lang-{lang}
视频专题首页topicindex
视频专题列表页topiclist/{id}-{pg}
视频搜索页search-pg-{pg}-wd-{wd}
文章首页artindex
文章分类页artlist/{id}-{pg}
文章内容页art/{id}-{pg}
文章地图页artmap
留言本gbook/{pg}
自定义页面label/{label}
RSSrss/{method}/{pg}

其中 {id} 一般表示对应的数据 ID,{pg} 表示分页页码,{src} 表示播放或下载来源,{num} 表示播放集数等参数。

部分伪静态路径中的前缀可以根据实际网站需求进行调整,例如 typedetailplay 等都是路径前缀。修改规则时必须保证程序 URL 生成规则与服务器重写规则保持一致,否则容易出现链接访问 404 的情况。

苹果CMS V10 httpd.ini伪静态规则

httpd.ini 主要用于支持 ISAPI_Rewrite 的 IIS 环境。配置时通常将规则放到网站对应的伪静态配置文件中。

[ISAPI_Rewrite]
#3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
RewriteRule ^type/(.*)-(.*)$ /index.php?m=vod-type-id-$1-pg-$2 [I]
RewriteRule ^detail/(.*)$ /index.php?m=vod-detail-id-$1 [I]
RewriteRule ^play/(.*)-(.*)-(.*)$ /index.php?m=vod-play-id-$1-src-$2-num-$3 [I]
RewriteRule ^down/(.*)-(.*)-(.*)$ /index.php?m=vod-down-id-$1-src-$2-num-$3 [I]
RewriteRule ^topiclist/(.*)-(.*)$ /index.php?m=vod-topic-id-$1-pg-$2 [I]
RewriteRule ^topicindex(.*)$ /index.php?m=vod-topicindex-pg-$1 [I]
RewriteRule ^artindex(.*)$ /index.php?m=art-index-pg-$1 [I]
RewriteRule ^artlist/(.*)-(.*)$ /index.php?m=art-type-id-$1-pg-$2 [I]
RewriteRule ^art/(.*)-(.*)$ index.php?m=art-detail-id-$1-pg-$2 [I]
RewriteRule ^label/(.*)$ /index.php?m=label-$1 [I]
RewriteRule ^map(.*)$ /index.php?m=vod-map$1 [I]
RewriteRule ^artmap(.*)$ /index.php?m=art-map$1 [I]
RewriteRule ^gbook/(.*)$ /index.php?m=gbook-show-pg-$1 [I]
RewriteRule ^search-pg-(.*)-wd-(.*)$ /index.php?m=vod-search-pg-$1-wd-$2 [I]
RewriteRule ^rss/(.*)/(.*)$ /index.php?m=map-$1 [I]
RewriteRule ^vod-list-id-(.*)-pg-(.*)-order-(.*)-by-(.*)-class-(.*)-year-(.*)-letter-(.*)-area-(.*)-lang-(.*)$ /index.php?m=vod-list-id-$1-pg-$2-wd-$3-area-$4-lang-$5-year-$6-letter-$7-order-$8-by-$9 [I]

苹果CMS V10 .htaccess伪静态规则

如果服务器使用 Apache,一般使用网站根目录下的 .htaccess 文件配置 Rewrite 规则。

下面是常用的苹果CMS V10 Apache 伪静态规则:

# 将 RewriteEngine 模式打开
RewriteEngine On

# 修改以下语句中的 /maccms 为你的网站目录地址,
# 如果程序放在根目录中,请将 /maccms 修改为 /
RewriteBase /

# Rewrite 系统规则请勿修改
RewriteRule ^type/(.*)-(.*)$ index.php?m=vod-type-id-$1-pg-$2
RewriteRule ^detail/(.*)$ index.php?m=vod-detail-id-$1
RewriteRule ^play/(.*)-(.*)-(.*)$ index.php?m=vod-play-id-$1-src-$2-num-$3
RewriteRule ^down/(.*)-(.*)-(.*)$ index.php?m=vod-down-id-$1-src-$2-num-$3
RewriteRule ^topiclist/(.*)-(.*)$ index.php?m=vod-topic-id-$1-pg-$2
RewriteRule ^topicindex(.*)$ index.php?m=vod-topicindex-pg-$1
RewriteRule ^artindex(.*)$ index.php?m=art-index-pg-$1
RewriteRule ^artlist/(.*)-(.*)$ index.php?m=art-type-id-$1-pg-$2
RewriteRule ^art/(.*)-(.*)$ index.php?m=art-detail-id-$1-pg-$2
RewriteRule ^label/(.*)$ index.php?m=label-$1
RewriteRule ^map(.*)$ index.php?m=vod-map$1
RewriteRule ^artmap(.*)$ index.php?m=art-map$1
RewriteRule ^gbook/(.*)$ index.php?m=gbook-show-pg-$1
RewriteRule ^search-pg-(.*)-wd-(.*)$ index.php?m=vod-search-pg-$1-wd-$2
RewriteRule ^rss/(.*)/(.*)$ index.php?m=map-$1
RewriteRule ^vod-list-id-(.*)-pg-(.*)-order-(.*)-by-(.*)-class-(.*)-year-(.*)-letter-(.*)-area-(.*)-lang-(.*)$ index.php?m=vod-list-id-$1-pg-$2-wd-$3-area-$4-lang-$5-year-$6-letter-$7-order-$8-by-$9

Apache环境配置注意事项

  • RewriteEngine On 必须正常启用。

  • RewriteBase 应根据网站实际安装目录进行设置。

  • 如果苹果CMS安装在网站根目录,通常使用 RewriteBase /

  • 如果程序安装在子目录,需要按照实际目录调整 RewriteBase。

  • 服务器必须允许网站目录使用 .htaccess

  • 修改规则后建议清理浏览器缓存,并重新测试首页、分类页、详情页和播放页。

苹果CMS V10 maccms.conf伪静态规则

maccms.conf 通常用于 Nginx 等环境中的 Rewrite 配置。实际使用时需要根据服务器安装目录以及站点配置进行调整。

#安装目录
#1、根目录 /
#2、子目录 /maccms8_syb/

rewrite ^/type/(.*)-(.*)$ index.php?m=vod-type-id-$1-pg-$2 break;
rewrite ^/detail/(.*)$ index.php?m=vod-detail-id-$1 break;
rewrite ^/play/(.*)-(.*)-(.*)$ index.php?m=vod-play-id-$1-src-$2-num-$3 break;
rewrite ^/down/(.*)-(.*)-(.*)$ index.php?m=vod-down-id-$1-src-$2-num-$3 break;
rewrite ^/topiclist/(.*)-(.*)$ index.php?m=vod-topic-id-$1-pg-$2 break;
rewrite ^/topicindex(.*)$ index.php?m=vod-topicindex-pg-$1 break;
rewrite ^/artindex(.*)$ index.php?m=art-index-pg-$1 break;
rewrite ^/artlist/(.*)-(.*)$ index.php?m=art-type-id-$1-pg-$2 break;
rewrite ^/art/(.*)-(.*)$ index.php?m=art-detail-id-$1-pg-$2 break;
rewrite ^/label/(.*)$ index.php?m=label-$1 break;
rewrite ^/map(.*)$ index.php?m=vod-map$1 break;
rewrite ^/artmap(.*)$ index.php?m=art-map$1 break;
rewrite ^/gbook/(.*)$ index.php?m=gbook-show-pg-$1 break;
rewrite ^/search-pg-(.*)-wd-(.*)$ index.php?m=vod-search-pg-$1-wd-$2 break;
rewrite ^/rss/(.*)/(.*)$ index.php?m=map-$1 break;
rewrite ^/vod-list-id-(.*)-pg-(.*)-order-(.*)-by-(.*)-class-(.*)-year-(.*)-letter-(.*)-area-(.*)-lang-(.*)$ index.php?m=vod-list-id-$1-pg-$2-wd-$3-area-$4-lang-$5-year-$6-letter-$7-order-$8-by-$9 break;

Nginx伪静态配置提醒

如果使用的是 Nginx,需要确认 Rewrite 规则实际加载到了当前站点配置中。仅仅把规则文件上传到服务器,并不会自动让 Nginx 生效。

修改 Nginx 配置后,一般还需要检查配置文件是否存在语法错误,并重新加载 Web 服务。具体命令根据服务器环境和安装方式有所不同。

苹果CMS V10 web.config伪静态规则

Windows IIS 环境除了 ISAPI_Rewrite 之外,也可以通过 web.config 配置 URL Rewrite。下面是苹果CMS V10 常用 IIS Rewrite 规则:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>

<rule name="Imported Rule vodtype">
<!-- 视频分类页 -->
<match url="^type/(.*)-(.*)$" />
<action type="Rewrite" url="index.php?m=vod-type-id-{R:1}-pg-{R:2}" appendQueryString="false" />
</rule>

<rule name="Imported Rule voddetail">
<!-- 视频内容页 -->
<match url="^detail/(.*)$" />
<action type="Rewrite" url="index.php?m=vod-detail-id-{R:1}" appendQueryString="false" />
</rule>

<rule name="Imported Rule vodplay">
<!-- 视频播放页 -->
<match url="^play/(.*)-(.*)-(.*)$" />
<action type="Rewrite" url="index.php?m=vod-play-id-{R:1}-src-{R:2}-num-{R:3}" appendQueryString="false" />
</rule>

<rule name="Imported Rule voddown">
<!-- 视频下载页 -->
<match url="^down/(.*)-(.*)-(.*)$" />
<action type="Rewrite" url="index.php?m=vod-down-id-{R:1}-src-{R:2}-num-{R:3}" appendQueryString="false" />
</rule>

<rule name="Imported Rule vodsearch">
<!-- 视频搜索页 -->
<match url="^search-pg-(.*)-wd-(.*)$" />
<action type="Rewrite" url="index.php?m=vod-search-pg-{R:1}-wd-{R:2}" appendQueryString="false" />
</rule>

<rule name="Imported Rule vodmap">
<!-- 视频地图 -->
<match url="^map(.*)$" />
<action type="Rewrite" url="index.php?m=vod-map{R:1}" appendQueryString="false" />
</rule>

<rule name="Imported Rule shaixuan">
<!-- 筛选页面 -->
<match url="^vod-list-id-(.*)-pg-(.*)-order-(.*)-by-(.*)-class-(.*)-year-(.*)-letter-(.*)-area-(.*)-lang-(.*)$" />
<action type="Rewrite" url="index.php?m=vod-list-id-{R:1}-pg-{R:2}-wd-{R:3}-area-{R:4}-lang-{R:5}-year-{R:6}-letter-{R:7}-order-{R:8}-by-{R:9}" appendQueryString="false" />
</rule>

<rule name="Imported Rule ztlist">
<!-- 视频专题列表页 -->
<match url="^topiclist/(.*)-(.*)$" />
<action type="Rewrite" url="index.php?m=vod-topic-id-{R:1}-pg-{R:2}" appendQueryString="false" />
</rule>

<rule name="Imported Rule topic">
<!-- 视频专题首页 -->
<match url="^topicindex(.*)$" />
<action type="Rewrite" url="index.php?m=vod-topicindex-pg-{R:1}" appendQueryString="false" />
</rule>

<rule name="Imported Rule artindex">
<!-- 文章首页 -->
<match url="^artindex(.*)$" />
<action type="Rewrite" url="index.php?m=art-index-pg-{R:1}" appendQueryString="false" />
</rule>

<rule name="Imported Rule arttype">
<!-- 文章分类页 -->
<match url="^artlist/(.*)-(.*)$" />
<action type="Rewrite" url="index.php?m=art-type-id-{R:1}-pg-{R:2}" appendQueryString="false" />
</rule>

<rule name="Imported Rule artdetail">
<!-- 文章内容页 -->
<match url="^art/(.*)-(.*)$" />
<action type="Rewrite" url="index.php?m=art-detail-id-{R:1}-pg-{R:2}" appendQueryString="false" />
</rule>

<rule name="Imported Rule gbook">
<!-- 留言本 -->
<match url="^gbook/(.*)$" />
<action type="Rewrite" url="index.php?m=gbook-show-pg-{R:1}" appendQueryString="false" />
</rule>

<rule name="Imported Rule label">
<!-- 自定义页 -->
<match url="^label/(.*)$" />
<action type="Rewrite" url="index.php?m=label-{R:1}" appendQueryString="false" />
</rule>

<rule name="Imported Rule artmap">
<!-- 文章地图页 -->
<match url="^artmap(.*)$" />
<action type="Rewrite" url="index.php?m=art-map{R:1}" appendQueryString="false" />
</rule>

<rule name="Imported Rule rss">
<!-- RSS地图页 -->
<match url="^rss/(.*)/(.*)$" />
<action type="Rewrite" url="index.php?m=map{R:1}" appendQueryString="false" />
</rule>

</rules>
</rewrite>
</system.webServer>
</configuration>

苹果CMS伪静态规则怎么选择

服务器环境常见规则文件配置位置
Apache.htaccess网站根目录
IIS + ISAPI_Rewritehttpd.ini网站规则配置
Nginxmaccms.confNginx站点配置
IIS URL Rewriteweb.config网站根目录

因此,配置伪静态之前首先要确认网站当前使用的 Web 服务器,而不是把几种规则文件全部上传到网站目录中。

苹果CMS伪静态配置后的测试方法

伪静态配置完成后,建议按照页面类型逐项测试,不要只测试首页。

  • 首页是否可以正常打开。

  • 视频分类页是否正常访问。

  • 视频详情页是否出现 404。

  • 播放页能否正常打开。

  • 视频下载页是否正常。

  • 搜索页面能否正常提交关键词。

  • 专题、文章分类和文章详情页是否正常。

  • 分页第二页及后续页面是否可以访问。

  • 网站地图、留言本等功能是否正常。

如果首页正常,而分类页、详情页或播放页出现 404,一般说明伪静态规则没有完整匹配当前 URL,或者服务器 Rewrite 功能没有正确启用。

苹果CMS伪静态常见问题

1、配置后所有页面都404怎么办?

首先检查服务器是否真正启用了 Rewrite 功能,然后确认规则文件放置位置是否正确。Apache、Nginx 和 IIS 的配置方式不同,不能直接混用。

2、苹果CMS放在子目录怎么配置?

如果网站不是安装在域名根目录,需要根据实际安装目录调整规则。尤其是 Apache 的 RewriteBase 以及 Nginx 站点配置中的路径。

例如程序安装在 /maccms 子目录,就不能完全按照根目录网站的配置方式直接套用。

3、为什么只有播放页打不开?

播放页 URL 通常包含视频 ID、播放来源和集数等多个参数,例如:

play/{id}-{src}-{num}

因此需要重点检查播放页对应的三段参数 Rewrite 规则是否存在,并确认模板生成的播放 URL 与服务器规则保持一致。

4、修改伪静态后需要修改模板吗?

通常情况下,正常使用苹果CMS官方 URL 生成函数的模板不需要因为服务器更换伪静态规则而大量修改。真正需要保持一致的是程序生成的 URL 格式与服务器 Rewrite 规则。

苹果CMS V10伪静态配置总结

苹果CMS V10 的伪静态规则主要负责将网站访问路径映射到对应的程序模块。不同服务器环境需要使用不同的规则文件,Apache 常见的是 .htaccess,IIS 可以使用 httpd.iniweb.config,Nginx 则需要在站点配置中加入对应的 Rewrite 规则。

配置过程中最重要的是确认三个方面:服务器环境、网站安装目录、程序生成的URL格式。完成配置后,应依次测试分类、详情、播放、搜索、文章和分页等页面,确认不存在 404、循环跳转或参数丢失问题。

如果只是更换服务器环境,建议先备份原有伪静态配置,再根据新服务器类型选择对应规则,不要直接同时使用多套伪静态文件。