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; } }