1. Startseite
  2. CGI & Passagier
  3. Passenger applications do not inherit htaccess rules

Passenger applications do not inherit htaccess rules

Übersicht

.htaccess files are used to control behaviors of applications by overriding global server configuration. Any Passenger-based application, which includes Node, Python, and Ruby, will stop processing rules beyond the Dokumentenstamm, often noted by convention as öffentlich/.

Ursache

Passenger is managed by a separate facility that immediately takes control of the request once Apache detects that the document root is a Passenger application. Existing .htaccess directives, if provided in the Dokumentenstamm, are applied; however, any directives that lie below the document root (often noted as öffentlich/) are not inherited by design.

This is reflected by apache2_module/Hooks.cpp: passenger_register_hooks(), which blocks mod_dir (Hooks.cpp: startBlockingModDir()) that would be responsible for index negotiation, and therefore fulfillment of the request and .htaccess inheritance.

Lösung

.htaccess directives must be located immediately in the Dokumentenstamm of the Passenger application. No known workarounds exist to recursively inherit rules.

Aktualisiert am März 7, 2021

Verwandte Artikel