PbootCMS伪静态配置教程以及各web容器配置规则

时间:2023-03-30
pbootcms的伪静态规则官方其实都是写好的,文件就在根目录下的rewrite目录,其中Apache环境使用.htaccess,同时在规则中有两种情况,请注意;(虚拟主机如果用apache一般都是支持.htaccess文件的,如果不支持可咨询下空间商)
,具体伪静态规则如下:
<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>
如果是windows系统服务器用的IIS7+环境使用web.config,具体代码如下:
<?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>
Nginx请根据手册修改环境,将nginx.txt文件中的代码复制到伪静态中,代码如下:
#规则适合PbootCMS V2.0+版本
location / {
	if (!-e $request_filename){
		rewrite ^/(.*)$ /index.php?p=$1 last;
	}
}
 
上一篇:pbootcms域名授权码怎么获取,获取后怎么授权 下一篇:没有了

相关文章