文章摘要:PbootCMS伪静态配置教程;pbootcms的伪静态规则官方其实都是写好的,文件就在根目录下的rewrite目录,其中Apache环境使用.htaccess,同时在规则中有两种情况,请注意;(虚拟主机如果用apache一般都是支持.htaccess文件的,如果不支持可咨询下空间商)
PbootCMS伪静态配置教程
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;
}}本文采摘于网络,不代表本站立场,转载联系作者并注明出处:https://www.szwangzhanjianshe.com/WebsiteNews/321.html



