zblog伪静态排除目录规则

admin2022-08-1685976

第一种写法

location ~* ^/(?!(a|b)) {

if (-f $request_filename/index.html){

 rewrite (.*) $1/index.html;

}

if (-f $request_filename/index.php){

 rewrite (.*) $1/index.php;

}

if (!-f $request_filename){

 rewrite (.*) /index.php;

}

}


第二种写法:

location ~* ^/(?![a|b]) {

if (-f $request_filename/index.html){

 rewrite (.*) $1/index.html;

}

if (-f $request_filename/index.php){

 rewrite (.*) $1/index.php;

}

if (!-f $request_filename){

 rewrite (.*) /index.php;

}

}



location ~* ^/(?!(abc)) {

if (-f $request_filename/index.html){

 rewrite (.*) $1/index.html;

}

if (-f $request_filename/index.php){

 rewrite (.*) $1/index.php;

}

if (!-f $request_filename){

 rewrite (.*) /index.php;

}

}


网友评论