28#define APR_WANT_STRFUNC
40#define ALIAS_FLAG_DEFAULT -1
41#define ALIAS_FLAG_OFF 0
42#define ALIAS_FLAG_ON 1
44#define ALIAS_PRESERVE_PATH_DEFAULT 0
72module AP_MODULE_DECLARE_DATA alias_module;
75#define PREGSUB_ERROR (&magic_error_value)
128 :
base->allow_relative;
131 :
base->alias_preserve_path;
140 const char *fake,
const char *real,
161 return "Regular expression could not be compiled.";
173 new->handler =
cmd->info;
185 "The %s directive in %s at line %d will probably "
186 "never match because it overlaps an earlier "
188 cmd->cmd->name,
cmd->directive->filename,
189 cmd->directive->line_num,
190 alias->
handler ?
"Script" :
"",
191 alias->
regexp ?
"Match" :
"");
219 return "Alias must have two arguments when used globally";
227 "Cannot parse alias expression '", fake,
"': ",
err,
241 const char *fake,
const char *real)
249 const char *
arg3,
int use_regex)
258 const char *fake =
arg2;
289 return "Redirect: invalid first argument (of three)";
305 const char *expr_err =
NULL;
313 "Cannot parse redirect expression '",
url,
"': ", expr_err,
346 return "Regular expression could not be compiled.";
351 return "URL to redirect to is missing";
356 return "Redirect to non-URL";
360 return "Redirect URL not valid for this status";
371 new->redir_status =
status;
412 }
while (*
urip ==
'/');
446 "Can't evaluate alias expression: %s",
err);
494 "Can't evaluate redirect expression: %s",
err);
527 for (
i = 0;
i < aliases->
nelts; ++
i) {
556 "Regex substitution in '%s' failed. "
557 "Replacement too long?", alias->
real);
614 if (
r->
uri[0] !=
'/' &&
r->
uri[0] !=
'\0') {
632 "incomplete redirection target of '%s' for "
633 "URI '%s' modified to '%s'",
638 "cannot redirect '%s' to '%s'; "
639 "target is not a valid absoluteURI or abs_path",
687 "incomplete redirection target of '%s' for "
688 "URI '%s' modified to '%s'",
693 "cannot redirect '%s' to '%s'; "
694 "target is not a valid absoluteURI or abs_path",
716 "a fakename and a realname, or a realname in a Location"),
718 "a fakename and a realname, or a realname in a Location"),
721 "an optional status, then document to be redirected and "
724 "a regular expression and a filename"),
726 "a regular expression and a filename"),
729 "an optional status, then a regular expression and "
733 "a document to be redirected, then the destination URL"),
736 "a document to be redirected, then the destination URL"),
739 "Set to ON to allow relative redirect targets to be issued as-is"),
742 "Set to ON to map the full path after the fakename to the realname."),
750 static const char *
const aszSucc[]={
"mod_userdir.c",
751 "mod_vhost_alias.c",
NULL };
Symbol export macros and hook functions.
APR general purpose library routines.
apr_size_t const unsigned char unsigned int unsigned int d
apr_array_append(apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second)
APR Standard Headers Support.
#define AP_INIT_TAKE123(directive, func, mconfig, where, help)
#define ap_get_module_config(v, m)
struct ap_conf_vector_t ap_conf_vector_t
#define AP_DECLARE_MODULE(foo)
#define AP_INIT_FLAG(directive, func, mconfig, where, help)
char * ap_server_root_relative(apr_pool_t *p, const char *fname)
#define AP_INIT_TAKE12(directive, func, mconfig, where, help)
const char * ap_set_flag_slot(cmd_parms *cmd, void *struct_ptr, int arg)
#define AP_INIT_TAKE23(directive, func, mconfig, where, help)
#define AP_INIT_TAKE2(directive, func, mconfig, where, help)
char * ap_construct_url(apr_pool_t *p, const char *uri, request_rec *r)
void ap_hook_translate_name(ap_HOOK_translate_name_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
void ap_hook_fixups(ap_HOOK_fixups_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
apr_bucket apr_bucket_brigade * a
const char *const const char *const * aszSucc
#define APR_URI_UNP_OMITQUERY
#define AP_EXPR_FLAG_STRING_RESULT
#define ap_expr_parse_cmd(cmd, expr, flags, err, lookup_fn)
const char * ap_expr_str_exec(request_rec *r, const ap_expr_info_t *expr, const char **err)
#define HTTP_INTERNAL_SERVER_ERROR
#define HTTP_MOVED_TEMPORARILY
#define ap_is_HTTP_REDIRECT(x)
#define HTTP_MOVED_PERMANENTLY
#define STANDARD20_MODULE_STUFF
int ap_is_url(const char *u)
#define ap_escape_uri(ppool, path)
void ap_set_context_info(request_rec *r, const char *prefix, const char *document_root)
char * ap_pregsub(apr_pool_t *p, const char *input, const char *source, apr_size_t nmatch, ap_regmatch_t pmatch[])
ap_regex_t * ap_pregcomp(apr_pool_t *p, const char *pattern, int cflags)
char * ap_os_escape_path(apr_pool_t *p, const char *path, int partial)
#define NOT_IN_DIR_CONTEXT
const char * ap_check_cmd_context(cmd_parms *cmd, unsigned forbidden)
int strcasecmp(const char *a, const char *b)
#define apr_pcalloc(p, size)
apr_int32_t apr_int32_t apr_int32_t err
static const char * add_redirect_regex(cmd_parms *cmd, void *dirconf, const char *arg1, const char *arg2, const char *arg3)
static void * create_alias_dir_config(apr_pool_t *p, char *d)
static char * try_redirect(request_rec *r, int *status)
static int translate_alias_redir(request_rec *r)
static char * try_alias(request_rec *r)
static int alias_matches(const char *uri, const char *alias_fakename)
static void * merge_alias_dir_config(apr_pool_t *p, void *basev, void *overridesv)
static void * merge_alias_config(apr_pool_t *p, void *basev, void *overridesv)
static const char * add_alias_regex(cmd_parms *cmd, void *dummy, const char *fake, const char *real)
static const char * add_alias_internal(cmd_parms *cmd, void *dummy, const char *fake, const char *real, int use_regex)
static int fixup_redir(request_rec *r)
static const command_rec alias_cmds[]
static void register_hooks(apr_pool_t *p)
static char magic_error_value
static char * try_alias_list(request_rec *r, apr_array_header_t *aliases, int is_redir, int *status)
static const char * add_redirect_internal(cmd_parms *cmd, alias_dir_conf *dirconf, const char *arg1, const char *arg2, const char *arg3, int use_regex)
static const char * add_alias(cmd_parms *cmd, void *dummy, const char *fake, const char *real)
static void * create_alias_config(apr_pool_t *p, server_rec *s)
#define ALIAS_FLAG_DEFAULT
static const char * add_redirect2(cmd_parms *cmd, void *dirconf, const char *arg1, const char *arg2)
static const char * add_redirect(cmd_parms *cmd, void *dirconf, const char *arg1, const char *arg2, const char *arg3)
const ap_expr_info_t * alias
unsigned int redirect_set
apr_array_header_t * redirects
const ap_expr_info_t * redirect
apr_array_header_t * redirects
apr_array_header_t * aliases
A structure that represents the current request.
struct ap_conf_vector_t * per_dir_config
apr_table_t * headers_out
A structure to store information for each virtual server.
struct ap_conf_vector_t * module_config
typedef int(WSAAPI *apr_winapi_fpt_WSAPoll)(IN OUT LPWSAPOLLFD fdArray