Achieve Directory Handling
Created November 6, 2026 · Updated November 6, 2026 · Achieve 3.1.0 · Qualified runtime: Node.js 24.22.2
Achieve gives directory URLs a canonical slash form and resolves a fixed default-document sequence inside the configured application space.
Canonical slash redirect
When a resolved target is a directory and the request path lacks a trailing slash, Achieve returns 301 with Location set to the slash form. The complete query substring is retained. The redirect occurs before default-document selection so relative links in the eventual document resolve against the directory URL.
Default-document order
For a slash-form directory, Achieve selects the first existing contained entry in this exact order:
index.htmlindex.htmindex.jssindex.jss.mjsindex.jss.cjsindex.js
The HTML forms are static resources. The .jss forms and legacy index.js are executed as servlets rather than returned as source.
Containment and absence
Each candidate must remain physically within the application space. Symlink or mapped-path escape is rejected. A directory with no eligible default document proceeds as not found; Achieve does not generate a directory listing.
Routing and HEAD
Exact and subtree maps can select another contained directory before lookup. HEAD follows the same redirect/default selection but suppresses response content. See HTTP Redirects and Application-Space Routing.
Verification
Request-path, static-lookup, servlet-module, route/path-map, physical-containment, HEAD, and logging suites verify slash redirects, query preservation, priority order, servlet execution, missing indexes, and protected paths.
