mod_alias.c revision 66a73d4405f9d941672c0343b36f6c494413a6b5
842ae4bd224140319ae7feec1872b93dfd491143fielding/* Licensed to the Apache Software Foundation (ASF) under one or more
842ae4bd224140319ae7feec1872b93dfd491143fielding * contributor license agreements. See the NOTICE file distributed with
842ae4bd224140319ae7feec1872b93dfd491143fielding * this work for additional information regarding copyright ownership.
842ae4bd224140319ae7feec1872b93dfd491143fielding * The ASF licenses this file to You under the Apache License, Version 2.0
842ae4bd224140319ae7feec1872b93dfd491143fielding * (the "License"); you may not use this file except in compliance with
842ae4bd224140319ae7feec1872b93dfd491143fielding * the License. You may obtain a copy of the License at
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding *
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * http://www.apache.org/licenses/LICENSE-2.0
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding *
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * Unless required by applicable law or agreed to in writing, software
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * distributed under the License is distributed on an "AS IS" BASIS,
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * See the License for the specific language governing permissions and
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * limitations under the License.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding/*
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * http_alias.c: Stuff for dealing with directory aliases
e8f95a682820a599fe41b22977010636be5c2717jim *
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Original by Rob McCool, rewritten in succession by David Robinson
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * and rst.
e8f95a682820a599fe41b22977010636be5c2717jim *
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
b6055b7832a0e4d0818416252fff5925aaebae4brbb#include "apr_strings.h"
1b21d7b3d97def358b2e923655edeb16613a1c31gstein#include "apr_lib.h"
1b21d7b3d97def358b2e923655edeb16613a1c31gstein
1b21d7b3d97def358b2e923655edeb16613a1c31gstein#define APR_WANT_STRFUNC
1b21d7b3d97def358b2e923655edeb16613a1c31gstein#include "apr_want.h"
1b21d7b3d97def358b2e923655edeb16613a1c31gstein
2d71630471d1c23f0137309e3c3957c633ecbfd6rbb#include "ap_config.h"
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding#include "httpd.h"
449efc4dc68e42cc4421d15498a689618aab5dc3coar#include "http_core.h"
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding#include "http_config.h"
fd0edaa8e3d4dd67d0604ccef2e96b071db96643fielding#include "http_request.h"
a877b7d5d03f91d6c93076d9ccf14469c70c648dcoar#include "http_log.h"
1b21d7b3d97def358b2e923655edeb16613a1c31gstein
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingtypedef struct {
a7ad08f37d876bde1a32f0cf793f4799536ab1a5ben const char *real;
a7ad08f37d876bde1a32f0cf793f4799536ab1a5ben const char *fake;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding char *handler;
ef5650b61a8e35f3cc93ec07e73efc17ea329894jorton ap_regex_t *regexp;
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz int redir_status; /* 301, 302, 303, 410, etc */
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding} alias_entry;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingtypedef struct {
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm apr_array_header_t *aliases;
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm apr_array_header_t *redirects;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding} alias_server_conf;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingtypedef struct {
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm apr_array_header_t *redirects;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding} alias_dir_conf;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
3d96ee83babeec32482c9082c9426340cee8c44dwrowemodule AP_MODULE_DECLARE_DATA alias_module;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmstatic void *create_alias_config(apr_pool_t *p, server_rec *s)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding{
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding alias_server_conf *a =
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm (alias_server_conf *) apr_pcalloc(p, sizeof(alias_server_conf));
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
066877f1a045103acfdd376d48cdd473c33f409bdougm a->aliases = apr_array_make(p, 20, sizeof(alias_entry));
066877f1a045103acfdd376d48cdd473c33f409bdougm a->redirects = apr_array_make(p, 20, sizeof(alias_entry));
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding return a;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding}
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmstatic void *create_alias_dir_config(apr_pool_t *p, char *d)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding{
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding alias_dir_conf *a =
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm (alias_dir_conf *) apr_pcalloc(p, sizeof(alias_dir_conf));
066877f1a045103acfdd376d48cdd473c33f409bdougm a->redirects = apr_array_make(p, 2, sizeof(alias_entry));
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding return a;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding}
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmstatic void *merge_alias_config(apr_pool_t *p, void *basev, void *overridesv)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding{
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding alias_server_conf *a =
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm (alias_server_conf *) apr_pcalloc(p, sizeof(alias_server_conf));
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz alias_server_conf *base = (alias_server_conf *) basev;
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz alias_server_conf *overrides = (alias_server_conf *) overridesv;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
066877f1a045103acfdd376d48cdd473c33f409bdougm a->aliases = apr_array_append(p, overrides->aliases, base->aliases);
066877f1a045103acfdd376d48cdd473c33f409bdougm a->redirects = apr_array_append(p, overrides->redirects, base->redirects);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding return a;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding}
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmstatic void *merge_alias_dir_config(apr_pool_t *p, void *basev, void *overridesv)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding{
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding alias_dir_conf *a =
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm (alias_dir_conf *) apr_pcalloc(p, sizeof(alias_dir_conf));
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz alias_dir_conf *base = (alias_dir_conf *) basev;
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz alias_dir_conf *overrides = (alias_dir_conf *) overridesv;
066877f1a045103acfdd376d48cdd473c33f409bdougm a->redirects = apr_array_append(p, overrides->redirects, base->redirects);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding return a;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding}
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
4d7e28c869788fb00bffda29a67f1b10e19f159dnd/* need prototype for overlap check */
4d7e28c869788fb00bffda29a67f1b10e19f159dndstatic int alias_matches(const char *uri, const char *alias_fakename);
4d7e28c869788fb00bffda29a67f1b10e19f159dnd
a7ad08f37d876bde1a32f0cf793f4799536ab1a5benstatic const char *add_alias_internal(cmd_parms *cmd, void *dummy,
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz const char *f, const char *r,
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz int use_regex)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding{
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding server_rec *s = cmd->server;
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein alias_server_conf *conf = ap_get_module_config(s->module_config,
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein &alias_module);
066877f1a045103acfdd376d48cdd473c33f409bdougm alias_entry *new = apr_array_push(conf->aliases);
4d7e28c869788fb00bffda29a67f1b10e19f159dnd alias_entry *entries = (alias_entry *)conf->aliases->elts;
4d7e28c869788fb00bffda29a67f1b10e19f159dnd int i;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding /* XX r can NOT be relative to DocumentRoot here... compat bug. */
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding if (use_regex) {
ef5650b61a8e35f3cc93ec07e73efc17ea329894jorton new->regexp = ap_pregcomp(cmd->pool, f, AP_REG_EXTENDED);
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz if (new->regexp == NULL)
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz return "Regular expression could not be compiled.";
5600cf225f3be88ed9b5385a0737ccde7d0775bbrbb new->real = r;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding }
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe else {
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe /* XXX This may be optimized, but we must know that new->real
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe * exists. If so, we can dir merge later, trusing new->real
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe * and just canonicalizing the remainder. Not till I finish
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe * cleaning out the old ap_canonical stuff first.
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe */
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe new->real = r;
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding new->fake = f;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding new->handler = cmd->info;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
4d7e28c869788fb00bffda29a67f1b10e19f159dnd /* check for overlapping (Script)Alias directives
4d7e28c869788fb00bffda29a67f1b10e19f159dnd * and throw a warning if found one
4d7e28c869788fb00bffda29a67f1b10e19f159dnd */
4d7e28c869788fb00bffda29a67f1b10e19f159dnd if (!use_regex) {
4d7e28c869788fb00bffda29a67f1b10e19f159dnd for (i = 0; i < conf->aliases->nelts - 1; ++i) {
4d7e28c869788fb00bffda29a67f1b10e19f159dnd alias_entry *p = &entries[i];
4d7e28c869788fb00bffda29a67f1b10e19f159dnd
615244e3f9a19f00f305be7520a604c65ebcc193trawick if ( (!p->regexp && alias_matches(f, p->fake) > 0)
615244e3f9a19f00f305be7520a604c65ebcc193trawick || (p->regexp && !ap_regexec(p->regexp, f, 0, NULL, 0))) {
4d7e28c869788fb00bffda29a67f1b10e19f159dnd ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server,
1f0ca94141196628ecadf1a91f2b60a33349872fnd "The %s directive in %s at line %d will probably "
1f0ca94141196628ecadf1a91f2b60a33349872fnd "never match because it overlaps an earlier "
1f0ca94141196628ecadf1a91f2b60a33349872fnd "%sAlias%s.",
1f0ca94141196628ecadf1a91f2b60a33349872fnd cmd->cmd->name, cmd->directive->filename,
1f0ca94141196628ecadf1a91f2b60a33349872fnd cmd->directive->line_num,
fdc4c4c81c0ac7d8cfcec8f08ec89656df2164ffnd p->handler ? "Script" : "",
fdc4c4c81c0ac7d8cfcec8f08ec89656df2164ffnd p->regexp ? "Match" : "");
4d7e28c869788fb00bffda29a67f1b10e19f159dnd
4d7e28c869788fb00bffda29a67f1b10e19f159dnd break; /* one warning per alias should be sufficient */
4d7e28c869788fb00bffda29a67f1b10e19f159dnd }
4d7e28c869788fb00bffda29a67f1b10e19f159dnd }
4d7e28c869788fb00bffda29a67f1b10e19f159dnd }
4d7e28c869788fb00bffda29a67f1b10e19f159dnd
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding return NULL;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding}
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
a7ad08f37d876bde1a32f0cf793f4799536ab1a5benstatic const char *add_alias(cmd_parms *cmd, void *dummy, const char *f,
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz const char *r)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding{
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding return add_alias_internal(cmd, dummy, f, r, 0);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding}
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
a7ad08f37d876bde1a32f0cf793f4799536ab1a5benstatic const char *add_alias_regex(cmd_parms *cmd, void *dummy, const char *f,
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz const char *r)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding{
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding return add_alias_internal(cmd, dummy, f, r, 1);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding}
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
a7ad08f37d876bde1a32f0cf793f4799536ab1a5benstatic const char *add_redirect_internal(cmd_parms *cmd,
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz alias_dir_conf *dirconf,
e8f95a682820a599fe41b22977010636be5c2717jim const char *arg1, const char *arg2,
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick const char *arg3, int use_regex)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding{
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding alias_entry *new;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding server_rec *s = cmd->server;
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein alias_server_conf *serverconf = ap_get_module_config(s->module_config,
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein &alias_module);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding int status = (int) (long) cmd->info;
ef5650b61a8e35f3cc93ec07e73efc17ea329894jorton ap_regex_t *r = NULL;
a7ad08f37d876bde1a32f0cf793f4799536ab1a5ben const char *f = arg2;
a7ad08f37d876bde1a32f0cf793f4799536ab1a5ben const char *url = arg3;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
66a73d4405f9d941672c0343b36f6c494413a6b5rpluem if (!arg3 && !strcasecmp(arg1, "gone"))
172e83c0f024fe6396dd1f3ca3492fd83c304db5jim status = HTTP_GONE;
66a73d4405f9d941672c0343b36f6c494413a6b5rpluem else if (apr_isdigit(*arg1))
66a73d4405f9d941672c0343b36f6c494413a6b5rpluem status = atoi(arg1);
172e83c0f024fe6396dd1f3ca3492fd83c304db5jim else if (arg3) {
172e83c0f024fe6396dd1f3ca3492fd83c304db5jim if (!strcasecmp(arg1, "permanent"))
da128c59ec571c4dff70f41ecba9c8a9974c6cd6niq status = HTTP_MOVED_PERMANENTLY;
da128c59ec571c4dff70f41ecba9c8a9974c6cd6niq else if (!strcasecmp(arg1, "temp"))
da128c59ec571c4dff70f41ecba9c8a9974c6cd6niq status = HTTP_MOVED_TEMPORARILY;
da128c59ec571c4dff70f41ecba9c8a9974c6cd6niq else if (!strcasecmp(arg1, "seeother"))
da128c59ec571c4dff70f41ecba9c8a9974c6cd6niq status = HTTP_SEE_OTHER;
da128c59ec571c4dff70f41ecba9c8a9974c6cd6niq else {
da128c59ec571c4dff70f41ecba9c8a9974c6cd6niq return "Redirect: invalid first argument (of three)";
da128c59ec571c4dff70f41ecba9c8a9974c6cd6niq }
da128c59ec571c4dff70f41ecba9c8a9974c6cd6niq }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding else {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz f = arg1;
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz url = arg2;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding if (use_regex) {
ef5650b61a8e35f3cc93ec07e73efc17ea329894jorton r = ap_pregcomp(cmd->pool, f, AP_REG_EXTENDED);
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz if (r == NULL)
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz return "Regular expression could not be compiled.";
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding if (ap_is_HTTP_REDIRECT(status)) {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz if (!url)
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz return "URL to redirect to is missing";
c7ab5a433d38d5eae5fc0bb76be80ffab6e4f71dniq /* PR#35314: we can allow path components here;
c7ab5a433d38d5eae5fc0bb76be80ffab6e4f71dniq * they get correctly resolved to full URLs.
c7ab5a433d38d5eae5fc0bb76be80ffab6e4f71dniq */
c7ab5a433d38d5eae5fc0bb76be80ffab6e4f71dniq if (!use_regex && !ap_is_url(url) && (url[0] != '/'))
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz return "Redirect to non-URL";
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding else {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz if (url)
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz return "Redirect URL not valid for this status";
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding if (cmd->path)
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz new = apr_array_push(dirconf->redirects);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding else
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz new = apr_array_push(serverconf->redirects);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding new->fake = f;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding new->real = url;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding new->regexp = r;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding new->redir_status = status;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding return NULL;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding}
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
a7ad08f37d876bde1a32f0cf793f4799536ab1a5benstatic const char *add_redirect(cmd_parms *cmd, void *dirconf,
a7ad08f37d876bde1a32f0cf793f4799536ab1a5ben const char *arg1, const char *arg2,
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz const char *arg3)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding{
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding return add_redirect_internal(cmd, dirconf, arg1, arg2, arg3, 0);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding}
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
a7ad08f37d876bde1a32f0cf793f4799536ab1a5benstatic const char *add_redirect2(cmd_parms *cmd, void *dirconf,
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz const char *arg1, const char *arg2)
a7ad08f37d876bde1a32f0cf793f4799536ab1a5ben{
a7ad08f37d876bde1a32f0cf793f4799536ab1a5ben return add_redirect_internal(cmd, dirconf, arg1, arg2, NULL, 0);
a7ad08f37d876bde1a32f0cf793f4799536ab1a5ben}
a7ad08f37d876bde1a32f0cf793f4799536ab1a5ben
a7ad08f37d876bde1a32f0cf793f4799536ab1a5benstatic const char *add_redirect_regex(cmd_parms *cmd, void *dirconf,
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz const char *arg1, const char *arg2,
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz const char *arg3)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding{
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding return add_redirect_internal(cmd, dirconf, arg1, arg2, arg3, 1);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding}
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingstatic const command_rec alias_cmds[] =
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding{
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick AP_INIT_TAKE2("Alias", add_alias, NULL, RSRC_CONF,
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick "a fakename and a realname"),
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick AP_INIT_TAKE2("ScriptAlias", add_alias, "cgi-script", RSRC_CONF,
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick "a fakename and a realname"),
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick AP_INIT_TAKE23("Redirect", add_redirect, (void *) HTTP_MOVED_TEMPORARILY,
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick OR_FILEINFO,
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick "an optional status, then document to be redirected and "
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick "destination URL"),
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick AP_INIT_TAKE2("AliasMatch", add_alias_regex, NULL, RSRC_CONF,
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick "a regular expression and a filename"),
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick AP_INIT_TAKE2("ScriptAliasMatch", add_alias_regex, "cgi-script", RSRC_CONF,
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick "a regular expression and a filename"),
e8f95a682820a599fe41b22977010636be5c2717jim AP_INIT_TAKE23("RedirectMatch", add_redirect_regex,
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick (void *) HTTP_MOVED_TEMPORARILY, OR_FILEINFO,
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick "an optional status, then a regular expression and "
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick "destination URL"),
a7ad08f37d876bde1a32f0cf793f4799536ab1a5ben AP_INIT_TAKE2("RedirectTemp", add_redirect2,
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz (void *) HTTP_MOVED_TEMPORARILY, OR_FILEINFO,
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick "a document to be redirected, then the destination URL"),
e8f95a682820a599fe41b22977010636be5c2717jim AP_INIT_TAKE2("RedirectPermanent", add_redirect2,
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick (void *) HTTP_MOVED_PERMANENTLY, OR_FILEINFO,
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick "a document to be redirected, then the destination URL"),
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding {NULL}
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding};
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingstatic int alias_matches(const char *uri, const char *alias_fakename)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding{
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding const char *aliasp = alias_fakename, *urip = uri;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
418c12fdca30a401f7921cf66d82f7061dc67149brianp while (*aliasp) {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz if (*aliasp == '/') {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz /* any number of '/' in the alias matches any number in
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz * the supplied URI, but there must be at least one...
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz */
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz if (*urip != '/')
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz return 0;
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz
fd7cb2b590294250e5b219512992cd5747289fbbbrianp do {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz ++aliasp;
fd7cb2b590294250e5b219512992cd5747289fbbbrianp } while (*aliasp == '/');
fd7cb2b590294250e5b219512992cd5747289fbbbrianp do {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz ++urip;
fd7cb2b590294250e5b219512992cd5747289fbbbrianp } while (*urip == '/');
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz }
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz else {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz /* Other characters are compared literally */
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz if (*urip++ != *aliasp++)
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz return 0;
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding /* Check last alias path component matched all the way */
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding if (aliasp[-1] != '/' && *urip != '\0' && *urip != '/')
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz return 0;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding /* Return number of characters from URI which matched (may be
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * greater than length of alias, since we may have matched
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * doubled slashes)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding */
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding return urip - uri;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding}
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantzstatic char *try_alias_list(request_rec *r, apr_array_header_t *aliases,
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz int doesc, int *status)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding{
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding alias_entry *entries = (alias_entry *) aliases->elts;
ef5650b61a8e35f3cc93ec07e73efc17ea329894jorton ap_regmatch_t regm[AP_MAX_REG_MATCH];
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding char *found = NULL;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding int i;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding for (i = 0; i < aliases->nelts; ++i) {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz alias_entry *p = &entries[i];
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz int l;
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz if (p->regexp) {
bbe046d7cbb950ab3e372e4119ae001a5fe52ed4striker if (!ap_regexec(p->regexp, r->uri, AP_MAX_REG_MATCH, regm, 0)) {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz if (p->real) {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz found = ap_pregsub(r->pool, p->real, r->uri,
bbe046d7cbb950ab3e372e4119ae001a5fe52ed4striker AP_MAX_REG_MATCH, regm);
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz if (found && doesc) {
8b99f2a316c5e2fa6ab208206fdd7fc2bfc4a921dougm apr_uri_t uri;
8b99f2a316c5e2fa6ab208206fdd7fc2bfc4a921dougm apr_uri_parse(r->pool, found, &uri);
376febd94e4df1954cffe683ed62fc285d95834djerenkrantz /* Do not escape the query string or fragment. */
e8f95a682820a599fe41b22977010636be5c2717jim found = apr_uri_unparse(r->pool, &uri,
376febd94e4df1954cffe683ed62fc285d95834djerenkrantz APR_URI_UNP_OMITQUERY);
376febd94e4df1954cffe683ed62fc285d95834djerenkrantz found = ap_escape_uri(r->pool, found);
6af61679f5d25e77f0d34112d714f9ae4cc666e3rbb if (uri.query) {
e8f95a682820a599fe41b22977010636be5c2717jim found = apr_pstrcat(r->pool, found, "?",
376febd94e4df1954cffe683ed62fc285d95834djerenkrantz uri.query, NULL);
6af61679f5d25e77f0d34112d714f9ae4cc666e3rbb }
376febd94e4df1954cffe683ed62fc285d95834djerenkrantz if (uri.fragment) {
e8f95a682820a599fe41b22977010636be5c2717jim found = apr_pstrcat(r->pool, found, "#",
376febd94e4df1954cffe683ed62fc285d95834djerenkrantz uri.fragment, NULL);
6af61679f5d25e77f0d34112d714f9ae4cc666e3rbb }
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz }
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz }
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz else {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz /* need something non-null */
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz found = apr_pstrdup(r->pool, "");
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz }
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz }
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz }
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz else {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz l = alias_matches(r->uri, p->fake);
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz if (l > 0) {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz if (doesc) {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz char *escurl;
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz escurl = ap_os_escape_path(r->pool, r->uri + l, 1);
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz found = apr_pstrcat(r->pool, p->real, escurl, NULL);
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz }
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz else
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz found = apr_pstrcat(r->pool, p->real, r->uri + l, NULL);
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz }
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz }
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz if (found) {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz if (p->handler) { /* Set handler, and leave a note for mod_cgi */
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz r->handler = p->handler;
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz apr_table_setn(r->notes, "alias-forced-type", r->handler);
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz }
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe /* XXX This is as SLOW as can be, next step, we optimize
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe * and merge to whatever part of the found path was already
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe * canonicalized. After I finish eliminating os canonical.
32c4bc04f89b16521718145dc731f750144d7b38wrowe * Better fail test for ap_server_root_relative needed here.
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe */
32c4bc04f89b16521718145dc731f750144d7b38wrowe if (!doesc) {
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe found = ap_server_root_relative(r->pool, found);
32c4bc04f89b16521718145dc731f750144d7b38wrowe }
32c4bc04f89b16521718145dc731f750144d7b38wrowe if (found) {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz *status = p->redir_status;
32c4bc04f89b16521718145dc731f750144d7b38wrowe }
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz return found;
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding return NULL;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding}
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingstatic int translate_alias_redir(request_rec *r)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding{
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein ap_conf_vector_t *sconf = r->server->module_config;
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein alias_server_conf *serverconf = ap_get_module_config(sconf, &alias_module);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding char *ret;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding int status;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz if (r->uri[0] != '/' && r->uri[0] != '\0') {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz return DECLINED;
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding if ((ret = try_alias_list(r, serverconf->redirects, 1, &status)) != NULL) {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz if (ap_is_HTTP_REDIRECT(status)) {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz /* include QUERY_STRING if any */
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz if (r->args) {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz ret = apr_pstrcat(r->pool, ret, "?", r->args, NULL);
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz }
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz apr_table_setn(r->headers_out, "Location", ret);
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz }
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz return status;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding if ((ret = try_alias_list(r, serverconf->aliases, 0, &status)) != NULL) {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz r->filename = ret;
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz return OK;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding return DECLINED;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding}
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingstatic int fixup_redir(request_rec *r)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding{
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding void *dconf = r->per_dir_config;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding alias_dir_conf *dirconf =
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding (alias_dir_conf *) ap_get_module_config(dconf, &alias_module);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding char *ret;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding int status;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding /* It may have changed since last time, so try again */
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding if ((ret = try_alias_list(r, dirconf->redirects, 1, &status)) != NULL) {
a877b7d5d03f91d6c93076d9ccf14469c70c648dcoar if (ap_is_HTTP_REDIRECT(status)) {
449efc4dc68e42cc4421d15498a689618aab5dc3coar if (ret[0] == '/') {
449efc4dc68e42cc4421d15498a689618aab5dc3coar char *orig_target = ret;
449efc4dc68e42cc4421d15498a689618aab5dc3coar
449efc4dc68e42cc4421d15498a689618aab5dc3coar ret = ap_construct_url(r->pool, ret, r);
1cde33c7e2019830f8fb3224e01649305583916etrawick ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
449efc4dc68e42cc4421d15498a689618aab5dc3coar "incomplete redirection target of '%s' for "
449efc4dc68e42cc4421d15498a689618aab5dc3coar "URI '%s' modified to '%s'",
449efc4dc68e42cc4421d15498a689618aab5dc3coar orig_target, r->uri, ret);
449efc4dc68e42cc4421d15498a689618aab5dc3coar }
a877b7d5d03f91d6c93076d9ccf14469c70c648dcoar if (!ap_is_url(ret)) {
a877b7d5d03f91d6c93076d9ccf14469c70c648dcoar status = HTTP_INTERNAL_SERVER_ERROR;
1cde33c7e2019830f8fb3224e01649305583916etrawick ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
a877b7d5d03f91d6c93076d9ccf14469c70c648dcoar "cannot redirect '%s' to '%s'; "
449efc4dc68e42cc4421d15498a689618aab5dc3coar "target is not a valid absoluteURI or abs_path",
a877b7d5d03f91d6c93076d9ccf14469c70c648dcoar r->uri, ret);
a877b7d5d03f91d6c93076d9ccf14469c70c648dcoar }
a877b7d5d03f91d6c93076d9ccf14469c70c648dcoar else {
affb82a2d7fc07c1a862d800ef47af966b898768nd /* append requested query only, if the config didn't
affb82a2d7fc07c1a862d800ef47af966b898768nd * supply its own.
affb82a2d7fc07c1a862d800ef47af966b898768nd */
affb82a2d7fc07c1a862d800ef47af966b898768nd if (r->args && !ap_strchr(ret, '?')) {
affb82a2d7fc07c1a862d800ef47af966b898768nd ret = apr_pstrcat(r->pool, ret, "?", r->args, NULL);
affb82a2d7fc07c1a862d800ef47af966b898768nd }
a877b7d5d03f91d6c93076d9ccf14469c70c648dcoar apr_table_setn(r->headers_out, "Location", ret);
a877b7d5d03f91d6c93076d9ccf14469c70c648dcoar }
a877b7d5d03f91d6c93076d9ccf14469c70c648dcoar }
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz return status;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding }
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding return DECLINED;
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding}
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding
73e8b26287de5c06fa470d36162e103dbac9c7e5wrowestatic void register_hooks(apr_pool_t *p)
fd0edaa8e3d4dd67d0604ccef2e96b071db96643fielding{
e8c95302287c86cd1f984eeb25cf3bfa9e2d33bbslive static const char * const aszSucc[]={ "mod_userdir.c",
e8c95302287c86cd1f984eeb25cf3bfa9e2d33bbslive "mod_vhost_alias.c",NULL };
fd0edaa8e3d4dd67d0604ccef2e96b071db96643fielding
1376737cb6afa24d3e12f3a223318fe1bd71bb1fslive ap_hook_translate_name(translate_alias_redir,NULL,aszSucc,APR_HOOK_MIDDLE);
b980ad7fdc218b4855cde9f75a747527f50c554dwrowe ap_hook_fixups(fixup_redir,NULL,NULL,APR_HOOK_MIDDLE);
fd0edaa8e3d4dd67d0604ccef2e96b071db96643fielding}
fd0edaa8e3d4dd67d0604ccef2e96b071db96643fielding
3d96ee83babeec32482c9082c9426340cee8c44dwrowemodule AP_MODULE_DECLARE_DATA alias_module =
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding{
fd0edaa8e3d4dd67d0604ccef2e96b071db96643fielding STANDARD20_MODULE_STUFF,
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz create_alias_dir_config, /* dir config creater */
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz merge_alias_dir_config, /* dir merger --- default is to override */
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz create_alias_config, /* server config */
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz merge_alias_config, /* merge server configs */
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz alias_cmds, /* command apr_table_t */
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz register_hooks /* register hooks */
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding};