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

(-)modules/mappers/mod_rewrite.c (-3 / +24 lines)
Lines 147-152 Link Here
147
#define RULEFLAG_NOSUB              1<<12
147
#define RULEFLAG_NOSUB              1<<12
148
#define RULEFLAG_STATUS             1<<13
148
#define RULEFLAG_STATUS             1<<13
149
#define RULEFLAG_ESCAPEBACKREF      1<<14
149
#define RULEFLAG_ESCAPEBACKREF      1<<14
150
#define RULEFLAG_ITERATE            1<<15
150
151
151
/* return code of the rewrite rule
152
/* return code of the rewrite rule
152
 * the result may be escaped - or not
153
 * the result may be escaped - or not
Lines 3261-3266 Link Here
3261
        }
3262
        }
3262
        break;
3263
        break;
3263
3264
3265
    case 'i':
3266
    case 'I':
3267
        if (!*key || !strcasecmp(key, "terate")) {         /* iterate */
3268
            cfg->flags |= RULEFLAG_ITERATE;
3269
        }
3270
        else {
3271
            ++error;
3272
        }
3273
        break;
3274
3264
    case 'l':
3275
    case 'l':
3265
    case 'L':
3276
    case 'L':
3266
        if (!*key || !strcasecmp(key, "ast")) {            /* last */
3277
        if (!*key || !strcasecmp(key, "ast")) {            /* last */
Lines 3936-3945 Link Here
3936
        rc = apply_rewrite_rule(p, ctx);
3947
        rc = apply_rewrite_rule(p, ctx);
3937
3948
3938
        if (rc) {
3949
        if (rc) {
3939
            /* Regardless of what we do next, we've found a match. Check to see
3950
            /* Regardless of what we do next, we've found a match.
3940
             * if any of the request header fields were involved, and add them
3951
             * Iterate over the rule as long as it matches,
3941
             * to the Vary field of the response.
3952
             * if the iteration flag has been set.
3953
             * Don't detroy return code from first match.
3942
             */
3954
             */
3955
            if (p->flags & RULEFLAG_ITERATE) {
3956
                while(apply_rewrite_rule(p, ctx)) {
3957
                }
3958
            }
3959
3960
            /*
3961
             * Check to see if any of the request header fields were
3962
             * involved, and add them to the Vary field of the response.
3963
             */
3943
            if (ctx->vary) {
3964
            if (ctx->vary) {
3944
                apr_table_merge(r->headers_out, "Vary", ctx->vary);
3965
                apr_table_merge(r->headers_out, "Vary", ctx->vary);
3945
            }
3966
            }
(-)docs/manual/mod/mod_rewrite.xml (+6 lines)
Lines 1318-1323 Link Here
1318
        inside the mapped directory to have a handler of
1318
        inside the mapped directory to have a handler of
1319
        ``<code>cgi-script</code>''.</dd>
1319
        ``<code>cgi-script</code>''.</dd>
1320
1320
1321
        <dt>
1322
        '<code>iterate|I</code>'
1323
        (iterate while match)</dt><dd>
1324
        Iterate the rewrite rule as long as the RewriteCond applies
1325
        and the <em>Pattern</em> matches.</dd>
1326
1321
        <dt>'<code>last|L</code>'
1327
        <dt>'<code>last|L</code>'
1322
        (last rule)</dt><dd> Stop the rewriting process
1328
        (last rule)</dt><dd> Stop the rewriting process
1323
        here and don't apply any more rewrite rules. This corresponds
1329
        here and don't apply any more rewrite rules. This corresponds

Return to bug 44279