# Author: Eduard Laas
# 2005 - 2026 SLAED
# License: MIT
# Website: slaed.net

# The project as document root, for a host whose root cannot be pointed at public/ (Apache and LiteSpeed only)
# Every request is rewritten into public/, the one part of the project a browser may reach, and public/.htaccess takes over there
# A file outside public/ is never served: its address lands in public/, where it does not exist and the front controller answers it

# Prevent directory listing
Options -Indexes

# A folder of the project, docs/ beside the Node type docs, is no address: without the slash redirect the path reaches the front controller
<IfModule mod_dir.c>
DirectorySlash Off
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

# Without mod_rewrite nothing is served at all: a host missing the module shows a broken site rather than the private part of the project
<IfModule !mod_rewrite.c>
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
</IfModule>
