# CW – Control & Watch: Modulverzeichnis bleibt standardmäßig gesperrt.
# Einzige öffentliche Ausnahme ist die virtuelle Modulhilfe
# /modules/help/<modulkey>/; sie wird an den CW-Frontcontroller weitergereicht.
Options -Indexes

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule ^help/[a-z][a-z0-9-]*/?$ /index.php [END,QSA,NC]
</IfModule>

<IfModule mod_authz_core.c>
  Require expr "%{REQUEST_URI} =~ m#(?:^|/)modules/help/[a-z][a-z0-9-]*/?$#"
</IfModule>

<IfModule !mod_authz_core.c>
  <IfModule mod_setenvif.c>
    SetEnvIf Request_URI "(?:^|/)modules/help/[a-z][a-z0-9-]*/?$" cw_public_module_help=1
  </IfModule>
  Order Deny,Allow
  Deny from all
  Allow from env=cw_public_module_help
</IfModule>
