| 425 |
|
|
| 426 |
if ((ret = try_alias_list(r, serverconf->redirects, 1, &status)) != NULL) { |
if ((ret = try_alias_list(r, serverconf->redirects, 1, &status)) != NULL) { |
| 427 |
if (ap_is_HTTP_REDIRECT(status)) { |
if (ap_is_HTTP_REDIRECT(status)) { |
| 428 |
/* include QUERY_STRING if any */ |
if (ret[0] == '/') { |
| 429 |
if (r->args) { |
char *orig_target = ret; |
| 430 |
|
|
| 431 |
|
ret = ap_construct_url(r->pool, ret, r); |
| 432 |
|
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, |
| 433 |
|
"incomplete redirection target of '%s' for " |
| 434 |
|
"URI '%s' modified to '%s'", |
| 435 |
|
orig_target, r->uri, ret); |
| 436 |
|
} |
| 437 |
|
if (!ap_is_url(ret)) { |
| 438 |
|
status = HTTP_INTERNAL_SERVER_ERROR; |
| 439 |
|
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, |
| 440 |
|
"cannot redirect '%s' to '%s'; " |
| 441 |
|
"target is not a valid absoluteURI or abs_path", |
| 442 |
|
r->uri, ret); |
| 443 |
|
} |
| 444 |
|
else { |
| 445 |
|
/* append requested query only, if the config didn't |
| 446 |
|
* supply its own. |
| 447 |
|
*/ |
| 448 |
|
if (r->args && !ap_strchr(ret, '?')) { |
| 449 |
ret = apr_pstrcat(r->pool, ret, "?", r->args, NULL); |
ret = apr_pstrcat(r->pool, ret, "?", r->args, NULL); |
| 450 |
} |
} |
| 451 |
apr_table_setn(r->headers_out, "Location", ret); |
apr_table_setn(r->headers_out, "Location", ret); |
| 452 |
} |
} |
| 453 |
|
} |
| 454 |
return status; |
return status; |
| 455 |
} |
} |
| 456 |
|
|