PbootCMS伪静态配置方法

 2022-02-19    662  

1.先去网站后台设置下伪静态

1.jpg

2.根据服务器环境来对应选择伪静态规则

如:

apache-->.htaccess

nginx-->nginx.txt

iis-->web.config

伪静态规则文件在网站根目录下-->rewrite文件夹内

2.jpg

3.伪静态规则详情如下(可复制到对应的伪静态规则内即可)

apache伪静态:

<IfModule mod_rewrite.c>
  Options +FollowSymlinks
  RewriteEngine On
  
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  
  RewriteRule ^(.*)$ index.php?p=$1 [QSA,PT,L]
</IfModule>

nginx伪静态:

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

IIS伪静态:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <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>
</configuration>


原文链接:http://www.77isp.com/post/9.html

=========================================

http://www.77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。