# ---------------------------------------------
# FORCE SPECIFIC URL TO 404
# ---------------------------------------------
RewriteRule ^index$ - [R=404,L]

# ---------------------------------------------
# FORCE HTTPS
# ---------------------------------------------
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# ---------------------------------------------
# REMOVE .php FROM URL
# ---------------------------------------------
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^/]+)/?$ $1.php [L]

# ---------------------------------------------
# REDIRECT page.php → /page (GET only)
# ---------------------------------------------
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{THE_REQUEST} "^[A-Z]{3,}\s([^.]+)\.php" [NC]
RewriteRule ^ %1 [R=302,L]

# ---------------------------------------------
# Redirect /index → homepage
# Redirect 301 /index https://barnsandnobleselfpublishers.com/
