# ELMEC Opnameformulieren - Apache configuratie
# Beveiliging en optimalisatie

# Bescherm gevoelige bestanden
<FilesMatch "(config\.php|database_schema\.sql|\.git.*|INSTALLATIE\.md)">
    Order Allow,Deny
    Deny from all
</FilesMatch>

# Bescherm uploads directory tegen direct uitvoeren van PHP
<Directory "uploads">
    php_flag engine off
    RemoveHandler .php .phtml .php3
    RemoveType .php .phtml .php3
</Directory>

# Bescherm schetsen directory
<Directory "schetsen">
    php_flag engine off
    RemoveHandler .php .phtml .php3
    RemoveType .php .phtml .php3
</Directory>

# Default index bestand
DirectoryIndex dashboard.php index.php index.html

# PHP instellingen
<IfModule mod_php5.c>
    php_value upload_max_filesize 10M
    php_value post_max_size 10M
    php_value max_execution_time 300
    php_value max_input_time 300
</IfModule>

# Compressie voor snellere laadtijden
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
</IfModule>

# Cache headers voor statische bestanden
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 month"
</IfModule>

# Voorkom directory listing
Options -Indexes

# Charset UTF-8
AddDefaultCharset UTF-8

# Error pages (optioneel, pas aan naar jouw situatie)
# ErrorDocument 404 /404.php
# ErrorDocument 500 /500.php
