Home Blog Photo Community Open Source
〖 Nginx URL重写(rewrite) 〗
Visits: 690
zane

Topics: 33
Posts: 37
No. 1

转载自: https://www.cnblogs.com/czlun/articles/7010604.html


rewrite    <regex>    <replacement>    [flag];

    关键字      正则        替代内容          flag标记

 

    关键字:其中关键字error_log不能改变

    正则:perl兼容正则表达式语句进行规则匹配

    替代内容:将正则匹配的内容替换成replacement

    flag标记:rewrite支持的flag标记

 

flag标记说明:

last  #本条规则匹配完成后,继续向下匹配新的location URI规则

break  #本条规则匹配完成即终止,不再匹配后面的任何规则

redirect  #返回302临时重定向,浏览器地址会显示跳转后的URL地址

permanent  #返回301永久重定向,浏览器地址栏会显示跳转后的URL地址

2018-08-23 18:08:45

Fatal error: Uncaught Error: Call to a member function count() on integer in /data/www/app/jxva.com/template/community/show.html:54 Stack trace: #0 /data/www/framework/View.php(121): require() #1 /data/www/app/jxva.com/action/CommunityAction.php(43): View->display('community/show....') #2 /data/www/framework/Controller.php(82): CommunityAction->show(Object(View)) #3 /data/www/index.php(4): Controller->execute() #4 {main} thrown in /data/www/app/jxva.com/template/community/show.html on line 54