# PHP Settings
<IfModule mod_php.c>
    php_value default_charset "UTF-8"
    php_value max_execution_time 300
    php_value max_input_time 300
    php_value max_input_vars 3000
    php_value memory_limit 256M
    php_value post_max_size 64M
    php_value upload_max_filesize 64M
    php_flag output_buffering on
    php_flag display_errors off
</IfModule>

# Directory Settings
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    # Allow PHP files to execute
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php [L]
</IfModule>

# Security Headers
<IfModule mod_headers.c>
    Header set X-Content-Type-Options "nosniff"
    Header set X-XSS-Protection "1; mode=block"
    Header set X-Frame-Options "SAMEORIGIN"
</IfModule>

# Directory access
<FilesMatch "^\.">
    Order allow,deny
    Deny from all
</FilesMatch>

# PHP file handling
<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
</FilesMatch>