pboot程序可以在许多服务器环境平台中运行,如果你是经常做网站的小伙伴,经常给客户做网站,一般都是在本地搭建服务器配置调试网站,调试成功后,给网站加完资料,就可以正式上线,博路网络boroad就经常用宝塔及phpstudy给网站在本地调试,现在主要来讲下phpstudy中如何给pboot进行伪静态,复制pboot的伪静态配置到nginx配置文件中,如果是宝塔的平台,那就比较简单了,直接复制代码到伪静态规则里,而在phpstudy 2016中如何配置伪静态呢?如果用的是nginx服务器,首先找到:nginx的伪静态代码,然后复制,如下代码:
#规则适合PbootCMS V2.0+版本
location / {
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?p=$1 last;
}
}
把上面代码:
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?p=$1 last;
}
放到phpstudy 2016中的配置文件:nginx-conf中,如下图:
打开以上的:nginx-conf文件后,找到里面有几行默认的代码,如下图:
location / {
index index.html index.htm index.php l.php;
autoindex off;
}
然后把上面的伪静态代码放入到里面就可以了,如下加了代码后的效果:
location / {
index index.html index.htm index.php l.php;
autoindex off;
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?p=$1 last;
}
}
最后确定,重新phpstudy 2016PHP集成环境,再进入网站后台,开启设置下伪静态功能,就可以打开网站了,这样伪静页就正式生效可以访问了。