#S################################
#开启404处理
fastcgi_intercept_errors on;
#匹配htm文件,如果不存在,则转向到php页面
location ~ /(.*)\.htm$ {
error_page 404 /rewrite.php?arg=$1;
}
location ~ /(.*)_(.*)\.htm$ {
error_page 404 /rewrite.php?arg=$1&arg=$2;
}
location ~ /(.*)_(.*)_(.*)\.htm$ {
error_page 404 /rewrite.php?arg=$1&arg=$2&arg=$3;
}
#对于其它的页面格式,则转向到输出
location ~ /(.*)_(.*)_(.*)_(.*)\.htm$ {
error_page 404 /rewrite/$1_$2_$3_$4.htm;
}
location ~ /rewrite/(.*).html$ {
#root /data/web/website3/except/;
return 200 "data:$1";
}
#E################################
nginx 通过 location 设置,先读取 htm 页面,如果页面不存在,再转向 php 页面
最新推荐文章于 2023-01-09 17:50:30 发布