# CT NAILS — Apache configuration
# ================================
# Recommended setup: point the domain's document root at this `public/`
# folder. Then `includes/`, `database/` and `uploads/` source files sit
# OUTSIDE the web root and cannot be reached by a browser at all.
#
# If your shared host only lets you use the project root as document root,
# the rules below block direct access to sensitive folders as a fallback.

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Block direct access to sensitive folders/files (fallback protection).
    RewriteRule ^(includes|database)/ - [F,L]
    RewriteRule ^includes/config\.php$ - [F,L]
    RewriteRule ^\.git - [F,L]

    # Pretty URLs (Phase 2+): /services, /booking, /gallery ...
    # Real .php files still work as normal. Uncomment the block below
    # once the matching pages exist — do not enable it yet in Phase 1.
    # RewriteCond %{REQUEST_FILENAME} !-f
    # RewriteCond %{REQUEST_FILENAME} !-d
    # RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

# Never list directory contents.
Options -Indexes

# NOTE: uploaded files are protected by uploads/.htaccess — uploaded
# PHP / scripts must never execute. Do NOT add a php-deny rule here:
# it would block this folder's own .php pages.

# Security headers (applied when mod_headers is available).
<IfModule mod_headers.c>
    Header set X-Content-Type-Options "nosniff"
    Header set X-Frame-Options "SAMEORIGIN"
    Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>
