# Caltech Tools — force one host version (non-www (apex))
# From Wayback URL domain → canonical https://pinebrookapartmentsofbutler.com
# Place this file in the site document root (Apache / LiteSpeed / aaPanel Apache).

<IfModule mod_rewrite.c>
RewriteEngine On

# Force HTTPS + canonical host (www or non-www) in one redirect when needed
RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{HTTP_HOST} !^pinebrookapartmentsofbutler\.com$ [NC]
RewriteRule ^ https://pinebrookapartmentsofbutler.com%{REQUEST_URI} [L,R=301]
</IfModule>

# Static HTML export — serve .html without extension when the file exists
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+?)/?$ $1.html [L]
</IfModule>

ErrorDocument 404 /404.html
