/[Apache-SVN]/httpd/httpd/trunk/modules/mappers/mod_alias.c
ViewVC logotype

Diff of /httpd/httpd/trunk/modules/mappers/mod_alias.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 780699, Mon Jun 1 15:57:48 2009 UTC revision 785575, Wed Jun 17 12:45:21 2009 UTC
# Line 425  static int translate_alias_redir(request Line 425  static int translate_alias_redir(request
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    

Legend:
Removed from v.780699  
changed lines
  Added in v.785575

apache@apache.org
ViewVC Help
Powered by ViewVC 1.1.2