diff --git a/include/types/http_ana.h b/include/types/http_ana.h index 5a7ced7b0..bc6609858 100644 --- a/include/types/http_ana.h +++ b/include/types/http_ana.h @@ -99,6 +99,7 @@ enum { REDIRECT_FLAG_NONE = 0, REDIRECT_FLAG_DROP_QS = 1, /* drop query string */ REDIRECT_FLAG_APPEND_SLASH = 2, /* append a slash if missing at the end */ + REDIRECT_FLAG_FROM_REQ = 3, /* redirect rule on the request path */ }; /* Redirect types (location, prefix, extended ) */ diff --git a/src/http_rules.c b/src/http_rules.c index 2e70e6bf0..f1a187b16 100644 --- a/src/http_rules.c +++ b/src/http_rules.c @@ -206,7 +206,7 @@ struct redirect_rule *http_parse_redirect_rule(const char *file, int linenum, st const char *destination = NULL; const char *cookie = NULL; int cookie_set = 0; - unsigned int flags = REDIRECT_FLAG_NONE; + unsigned int flags = (!dir ? REDIRECT_FLAG_FROM_REQ : REDIRECT_FLAG_NONE); struct acl_cond *cond = NULL; cur_arg = 0;