zblog安装在二级目录下伪静态设置方法,不加/也能正常访问,比如网站安装在blog目录下,伪静态规则如下:
location /blog/ { if (-f $request_filename/index.html) { rewrite (.*) $1/index.html break; } if (-f $request_filename/index.php) { rewrite (.*) $1/index.php; } if (!-f $request_filename) { rewrite (.*) /blog/index.php; } } location /blog { try_files $uri $uri/ /blog/index.html; }
根目录伪静态规则
location / { if (-f $request_filename/index.html) { rewrite (.*) $1/index.html break; } if (-f $request_filename/index.php) { rewrite (.*) $1/index.php; } if (!-f $request_filename) { rewrite (.*) /index.php; } }
还没有评论,来说两句吧...