# Enable Rewrite Engine
<IfModule mod_rewrite.c>
RewriteEngine On

# Force index.php as default
DirectoryIndex index.php index.html

# Redirect www to non-www (optional)
#RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
#RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

# Redirect to HTTPS (optional)
#RewriteCond %{HTTPS} off
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

</IfModule>

# Handle errors
ErrorDocument 400 /error_pages/400.html
ErrorDocument 401 /error_pages/401.html
ErrorDocument 403 /error_pages/403.html
ErrorDocument 404 /error_pages/404.html
ErrorDocument 500 /error_pages/500.html

# Disable directory browsing
Options -Indexes

# Set default charset
AddDefaultCharset UTF-8

# PHP error reporting (can comment out on production)
php_flag display_errors On
php_value error_reporting 32767
