phpGrace 默认已经为apache配置了伪静态规则文件.htaccess ,内容如下:

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

如果你的服务器是nginx的话,需要手动添加伪文件内容

server {
    listen 80;
    server_name  www.phpgrace.com phpgrace.com;
    root   "D:/webs/www.phpgrace.com";
    location /admin {
    index  index.html index.htm index.php;
      if (!-e $request_filename){
          rewrite ^/分组名称/(.*)$ /分组名称/index.php?pathInfo=$1;
        }
    }
    location / {
        index  index.html index.htm index.php;
        if (!-e $request_filename){
          rewrite ^(.*)$ ./index.php?pathInfo=$1;
        }
    }
}
Last modification:November 22nd, 2019 at 08:17 pm
如果觉得我的文章对你有用,请随意赞赏