PbootCMS 是一款比较轻便简单且适合基础标准版的PHP企业网站CMS程序,而且根据官方的标注是免费开源可商用的。有不少的朋友有将织梦CMS迁移到这款程序,且我们在设置后是支持伪静态URL路径的,但是我们需要根据服务器的引擎进行配置。这里老蒋整理来自PbootCMS官方的三款支持伪静态。
第一、IIS7 环境支持
如果是低版本的可能是不同的,这里选择支持IIS7的。

<?xml version="1.0" encoding="UTF-8"?>

<system.webServer>
    <rewrite>
        <rules>
             <rule name="reIndex" stopProcessing="true">
                <match url="^(.*)$" ignoreCase="true" />
                <conditions logicalGrouping="MatchAll">
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                </conditions>
                <action type="Rewrite" url="index.php?p={R:1}" appendQueryString="true" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>



第二、Apache环境
这里直接网站根目录的 .htaccess 文件。

Options +FollowSymlinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.*)$ index.php?p=$1 [QSA,PT,L]



第三、Nginx环境
Nginx如果我们服务器没有配置带自动配置的话,需要我们自己写入到Nginx配置说明中。
location / {

if (!-e $request_filename){
    rewrite ^/(.*)$ /index.php?p=$1 last;
 }

}


如果部署二级目录需要调整伪静态:
二级目录为test则:rewrite ^/test/(.*)$ /test/index.php?p=$1 last;

以上是我们常用的三个引擎环境。但是老蒋个人建议还是使用Linux服务器环境,比如Nginx或者Apache引擎都可以的。服务器可选这些商家。
1、UCloud 秋季和双十一活动发布 - CN2香港云服务器低至年70元
2、Megalayer 中秋国庆促销 美国香港菲律宾VPS年付159元 CN2优化带宽线路
3、全场RAKSmart VPS主机半价优惠 可选香港/日本/美国机房月2.6美元


扫描二维码,在手机上阅读!