All pastes #73788 Raw Edit

Jink

public c v1 · immutable
#73788 ·published 2006-06-28 08:30 UTC
rendered paste body
    case 'r':    case 'R':        if (!*key || !strcasecmp(key, "edirect")) {        /* redirect */            int status = 0;            cfg->flags |= RULEFLAG_FORCEREDIRECT;            if (strlen(val) > 0) {                if (strcasecmp(val, "permanent") == 0) {                    status = HTTP_MOVED_PERMANENTLY;                }                else if (strcasecmp(val, "temp") == 0) {                    status = HTTP_MOVED_TEMPORARILY;                }                else if (strcasecmp(val, "seeother") == 0) {                    status = HTTP_SEE_OTHER;                }                else if (apr_isdigit(*val)) {                    status = atoi(val);                    if (status != HTTP_INTERNAL_SERVER_ERROR) {                        int idx =                            ap_index_of_response(HTTP_INTERNAL_SERVER_ERROR);                        if (ap_index_of_response(status) == idx) {                            return apr_psprintf(p, "RewriteRule: invalid HTTP "                                                   "response code '%s' for "                                                   "flag 'R'",                                                val);                        }                    }                    if (!ap_is_HTTP_REDIRECT(status)) {                        cfg->flags |= (RULEFLAG_STATUS | RULEFLAG_NOSUB);                    }                }                cfg->forced_responsecode = status;            }        }