模板集市-武汉网商时代信息技术有限公司旗下低价建站平台
第一步:进入PbootCMS后台,依次点击全局配置-配置参数-url规则,勾选为伪静态模式,再点“立即提交”。
第二步:增加伪静态文件,不同环境的伪静态文件不同,具体如下:
(1)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>(2)Nginx环境,在nginx虚拟主机配置文件中添加规则,规则如下:
location / {
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?p=$1 last;
}
}(3)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>第三步、清理缓存,这步可不要忘记了,否则不会生效的。
