View | Details | Raw Unified | Return to bug 44279
Collapse All | Expand All

(-)modules/mappers/mod_rewrite.c (-3 / +24 lines)
Lines 152-157 Link Here
152
#define RULEFLAG_NOSUB              1<<12
152
#define RULEFLAG_NOSUB              1<<12
153
#define RULEFLAG_STATUS             1<<13
153
#define RULEFLAG_STATUS             1<<13
154
#define RULEFLAG_ESCAPEBACKREF      1<<14
154
#define RULEFLAG_ESCAPEBACKREF      1<<14
155
#define RULEFLAG_ITERATE            1<<15
155
156
156
/* return code of the rewrite rule
157
/* return code of the rewrite rule
157
 * the result may be escaped - or not
158
 * the result may be escaped - or not
Lines 3384-3389 Link Here
3384
        }
3385
        }
3385
        break;
3386
        break;
3386
3387
3388
    case 'i':
3389
    case 'I':
3390
        if (!*key || !strcasecmp(key, "terate")) {         /* iterate */
3391
            cfg->flags |= RULEFLAG_ITERATE;
3392
        }
3393
        else {
3394
            ++error;
3395
        }
3396
        break;
3397
3387
    case 'l':
3398
    case 'l':
3388
    case 'L':
3399
    case 'L':
3389
        if (!*key || !strcasecmp(key, "ast")) {            /* last */
3400
        if (!*key || !strcasecmp(key, "ast")) {            /* last */
Lines 4059-4068 Link Here
4059
        rc = apply_rewrite_rule(p, ctx);
4070
        rc = apply_rewrite_rule(p, ctx);
4060
4071
4061
        if (rc) {
4072
        if (rc) {
4062
            /* Regardless of what we do next, we've found a match. Check to see
4073
            /* Regardless of what we do next, we've found a match.
4063
             * if any of the request header fields were involved, and add them
4074
             * Iterate over the rule as long as it matches,
4064
             * to the Vary field of the response.
4075
             * if the iteration flag has been set.
4076
             * Don't detroy return code from first match.
4065
             */
4077
             */
4078
            if (p->flags & RULEFLAG_ITERATE) {
4079
                while(apply_rewrite_rule(p, ctx)) {
4080
                }
4081
            }
4082
4083
            /*
4084
             * Check to see if any of the request header fields were
4085
             * involved, and add them to the Vary field of the response.
4086
             */
4066
            if (ctx->vary) {
4087
            if (ctx->vary) {
4067
                apr_table_merge(r->headers_out, "Vary", ctx->vary);
4088
                apr_table_merge(r->headers_out, "Vary", ctx->vary);
4068
            }
4089
            }
(-)docs/manual/mod/mod_rewrite.xml (+6 lines)
Lines 1338-1343 Link Here
1338
        inside the mapped directory to have a handler of
1338
        inside the mapped directory to have a handler of
1339
        ``<code>cgi-script</code>''.</dd>
1339
        ``<code>cgi-script</code>''.</dd>
1340
1340
1341
        <dt>
1342
        '<code>iterate|I</code>'
1343
        (iterate while match)</dt><dd>
1344
        Iterate the rewrite rule as long as the RewriteCond applies
1345
        and the <em>Pattern</em> matches.</dd>
1346
1341
        <dt>'<code>last|L</code>'
1347
        <dt>'<code>last|L</code>'
1342
        (last rule)</dt><dd> Stop the rewriting process
1348
        (last rule)</dt><dd> Stop the rewriting process
1343
        here and don't apply any more rewrite rules. This corresponds
1349
        here and don't apply any more rewrite rules. This corresponds

Return to bug 44279