|
|
|
@ -270,7 +270,9 @@ SETDEFAULTS_FUNC(mod_rewrite_set_defaults) {
|
|
|
|
|
static int mod_rewrite_patch_connection(server *srv, connection *con, plugin_data *p) {
|
|
|
|
|
size_t i, j;
|
|
|
|
|
plugin_config *s = p->config_storage[0];
|
|
|
|
|
|
|
|
|
|
p->conf.rewrite = s->rewrite;
|
|
|
|
|
p->conf.context = NULL;
|
|
|
|
|
|
|
|
|
|
/* skip the first, the global context */
|
|
|
|
|
for (i = 1; i < srv->config_context->used; i++) {
|
|
|
|
@ -398,6 +400,12 @@ URIHANDLER_FUNC(mod_rewrite_uri_handler) {
|
|
|
|
|
if (num < (size_t)n) {
|
|
|
|
|
buffer_append_string(con->request.uri, list[num]);
|
|
|
|
|
}
|
|
|
|
|
} else if (p->conf.context == NULL) {
|
|
|
|
|
/* we have no context, we are global */
|
|
|
|
|
log_error_write(srv, __FILE__, __LINE__, "sb",
|
|
|
|
|
"used a redirect containing a %[0-9]+ in the global scope, ignored:",
|
|
|
|
|
rule->value);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
config_append_cond_match_buffer(con, p->conf.context, con->request.uri, num);
|
|
|
|
|
}
|
|
|
|
|