# Enable Rewrite Engine
RewriteEngine On

# -------------------------------------------------------------------
# Force HTTPS and non-www
# -------------------------------------------------------------------
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.judahfireworks\.com$ [NC]
RewriteRule ^(.*)$ https://judahfireworks.com/$1 [R=301,L]

# -------------------------------------------------------------------
# Allow clean URLs (/about → about.php)
# -------------------------------------------------------------------
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.php [NC,L]

# -------------------------------------------------------------------
# Blog slugs
# -------------------------------------------------------------------
RewriteRule ^blogs/([0-9a-zA-Z_/%.-]+)$ blogs.php?slug=$1 [L,QSA]

# -------------------------------------------------------------------
# Disable directory listing
# -------------------------------------------------------------------
<IfModule mod_negotiation.c>
    Options -MultiViews -Indexes
</IfModule>

# -------------------------------------------------------------------
# Allow PHP in .html files
# -------------------------------------------------------------------
AddType application/x-httpd-php .html
