pattern-matching procedure and the follow-up lines accepted by
this stanza are described below, under MATCHING.
-*capture* 'HANDLER'::
+*capture* 'HANDLER' ['FLAGS']::
Only meaningful in `.htrc` files. If a *capture* directive is
specified, then the URL-to-file mapping procedure as described
follow-up lines. Note that the `X-Ash-File` header is not
added to requests passed via *capture* directives.
+ If 'FLAGS' contain the character `R`, this *capture* directive
+ will be ignored if it is in the root directory that *dirplex*
+ serves.
+
MATCHING
--------
if(cf->capture != NULL)
free(cf->capture);
cf->capture = sstrdup(s->argv[1]);
+ cf->caproot = 1;
+ if((s->argc > 2) && strchr(s->argv[2], 'R'))
+ cf->caproot = 0;
} else if(!strcmp(s->argv[0], "eof")) {
break;
} else {
struct child *ch;
cf = getconfig(path);
- if(cf->capture != NULL) {
+ if((cf->capture != NULL) && (cf->caproot || !cf->path || strcmp(cf->path, "."))) {
cpath = sprintf2("%s/", path);
if((ch = findchild(cpath, cf->capture, &ccf)) == NULL) {
free(cpath);