mod_alias.c revision 172e83c0f024fe6396dd1f3ca3492fd83c304db5
561N/A/* Licensed to the Apache Software Foundation (ASF) under one or more 561N/A * contributor license agreements. See the NOTICE file distributed with 561N/A * this work for additional information regarding copyright ownership. 561N/A * The ASF licenses this file to You under the Apache License, Version 2.0 561N/A * (the "License"); you may not use this file except in compliance with 561N/A * the License. You may obtain a copy of the License at 561N/A * Unless required by applicable law or agreed to in writing, software 561N/A * distributed under the License is distributed on an "AS IS" BASIS, 561N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 561N/A * See the License for the specific language governing permissions and 561N/A * limitations under the License. 561N/A * Original by Rob McCool, rewritten in succession by David Robinson /* need prototype for overlap check */ const char *f,
const char *r,
/* XX r can NOT be relative to DocumentRoot here... compat bug. */ return "Regular expression could not be compiled.";
/* XXX This may be optimized, but we must know that new->real * exists. If so, we can dir merge later, trusing new->real * and just canonicalizing the remainder. Not till I finish * cleaning out the old ap_canonical stuff first. /* check for overlapping (Script)Alias directives * and throw a warning if found one "The %s directive in %s at line %d will probably " "never match because it overlaps an earlier " break;
/* one warning per alias should be sufficient */ return "Redirect: invalid first argument (of three)";
return "Regular expression could not be compiled.";
return "URL to redirect to is missing";
/* PR#35314: we can allow path components here; * they get correctly resolved to full URLs. return "Redirect to non-URL";
return "Redirect URL not valid for this status";
"a fakename and a realname"),
"a fakename and a realname"),
"an optional status, then document to be redirected and " "a regular expression and a filename"),
"a regular expression and a filename"),
"an optional status, then a regular expression and " "a document to be redirected, then the destination URL"),
"a document to be redirected, then the destination URL"),
/* any number of '/' in the alias matches any number in * the supplied URI, but there must be at least one... /* Other characters are compared literally */ /* Check last alias path component matched all the way */ /* Return number of characters from URI which matched (may be * greater than length of alias, since we may have matched /* Do not escape the query string or fragment. */ /* need something non-null */ if (p->
handler) {
/* Set handler, and leave a note for mod_cgi */ /* XXX This is as SLOW as can be, next step, we optimize * and merge to whatever part of the found path was already * canonicalized. After I finish eliminating os canonical. * Better fail test for ap_server_root_relative needed here. if (r->
uri[0] !=
'/' && r->
uri[0] !=
'\0') {
/* include QUERY_STRING if any */ /* It may have changed since last time, so try again */ "incomplete redirection target of '%s' for " "URI '%s' modified to '%s'",
"cannot redirect '%s' to '%s'; " "target is not a valid absoluteURI or abs_path",
/* append requested query only, if the config didn't