zoukankan      html  css  js  c++  java
  • nginx rewrite正则子组最多匹配到$9

    nginx rewrite正则匹配()匹配子组最多匹配到$9,就是从$0到$9

    当需要匹配更多子组时,可通过变量来实现

    if ($uri ~ ^/forum-15/sortid-74/(.*?)(lastpost|dateline)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+).html$){
        set $orderby $2;
        set $mdate $3;
        set $workhours $4;
        set $pricerange $5;
        set $page $6;

        rewrite ^([^.]*)/forum-15/sortid-74/(w+)/(w+)/(.*?)/(w+)/(w+)/(w+)/(lastpost|dateline)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/forum.php?mod=forumdisplay&fid=15&filter=sortid&sortid=74&epuipment=$2&brand=$3&model=$4&province=$5&city=$6&district=$7&mdate=$mdate&workhours=$workhours&pricerange=$pricerange&page=$page&orderby=$orderby last;
    }

  • 相关阅读:
    失格
    救赎
    篝火晚会
    旅行家的预算
    荒诞
    mod
    clique
    序列
    [CF932E]Team Work & [BZOJ5093]图的价值
    NOIWC2018游记
  • 原文地址:https://www.cnblogs.com/dongruiha/p/6847515.html
Copyright © 2011-2022 走看看