1,确认空间支持rewrite组件。
2,按照 伪静态rewrite 目录下的说明文档操作。
3,后台设置浏览模式为 rewrite伪静态 。
注意,以下规则都是在系统默认rewrite配置路径下测试的。 





如果使用rewrite伪静态模式,请注意把配置文件复制到网站根目录。
如果静态文件后缀配置的不是html,则请把rewrite配置文件中的.html替换为对应的后缀如.html

iis6.x下复制规则到 httpd.ini

1
2
3
4
5
6
7
8
9
10
11
[ISAPI_Rewrite]
#3600 = 1 hour
 
CacheClockRate 3600
RepeatLimit 32
 
RewriteRule ^/vod-(.*)$ /index.php\?m=vod-$1 [I]
RewriteRule ^/art-(.*)$ /index.php\?m=art-$1 [I]
RewriteRule ^/gbook-(.*)$ /index.php\?m=gbook-$1 [I]
RewriteRule ^/label-(.*)$ /index.php\?m=label-$1 [I]
RewriteRule ^/map-(.*)$ /index.php\?m=map-$1 [I]


 


iis7.x下复制规则到web.config

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule vod">
                    <match url="^vod-(.*)$" />
                    <action type="Rewrite" url="index.php\?m=vod-{R:1}" appendQueryString="false" />
                </rule>
                <rule name="Imported Rule art">
                    <match url="^art-(.*)$" />
                    <action type="Rewrite" url="index.php\?m=art-{R:1}" appendQueryString="false" />
                </rule>
        <rule name="Imported Rule gbook">
                    <match url="^gbook-(.*)$" />
                    <action type="Rewrite" url="index.php\?m=gbook-{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 map">
                    <match url="^map-(.*)$" />
                    <action type="Rewrite" url="index.php\?m=map-{R:1}" appendQueryString="false" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>



apache下复制规则到 .htaccess  
(编辑.htaccess文件,把 RewriteBase /maccms8 修改为你苹果CMS所在目录)

1
2
3
4
5
6
7
8
9
10
11
12
# 将 RewriteEngine 模式打开
RewriteEngine On
 
# 修改以下语句中的 /maccms 为你的网站目录地址,如果程序放在根目录中,请将 /maccms 修改为 /
RewriteBase /
 
# Rewrite 系统规则请勿修改
RewriteRule ^vod-(.*)$ index.php\?m=vod-$1
RewriteRule ^art-(.*)$ index.php\?m=art-$1
RewriteRule ^gbook-(.*)$ index.php\?m=gbook-$1
RewriteRule ^label-(.*)$ index.php\?m=label-$1
RewriteRule ^map-(.*)$ index.php\?m=map-$1



nginx下复制规则到maccms.conf

1
2
3
4
5
6
7
#安装目录  1,根目录 /  2,子目录 /maccms8_syb/
 
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;


(使用vps或者服务器的可以在你的主机的conf里 用 include xxxxx.conf   也就是包含下伪静态规则文件
如果用的是虚拟主机版的nginx 就找你的主机商给你添加规则就行,你把规则发给他。)

==========================苹果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 
希望本文苹果macCMS 8x Rewrite伪静态规则能给你学习maccms带来帮助。