原帖由 懒鸟飞 于 2019-03-13 13:05:16 发表 支持,请问Nginx的伪静态规则怎样写 |
if (!-f $request_filename){ set $rule_0 1$rule_0; } if ($request_uri !~ "^(/d/|/e/|/html/|/images/|/s/|/search/|/skin/|/t/|/ad/)"){ set $rule_0 2$rule_0; } if ($rule_0 = "21"){ rewrite ^/([0-9a-zA-Z-/]+)/(|index.html|index_[0-9]+.html)$ /e/action/list.php?classid=$1&page=$2 last; rewrite ^/([0-9a-zA-Z-/]+)/([0-9a-zA-Z]+)([_0-9]*).html$ /e/action/show.php?classid=$1&id=$2&page=$3 last; } if (!-e $request_filename) { return 404; }
|