Options +FollowSymLinks
Options -Indexes

RewriteEngine On

# Redirect index.php to root URL
RewriteCond %{THE_REQUEST} \s/+index\.php[\s?] [NC]
RewriteRule ^index\.php$ / [R=301,L]

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

# Redirect old .php URLs to clean URLs
RewriteCond %{THE_REQUEST} \s/+page-([^.]+)\.php[\s?] [NC]
RewriteRule ^page-([^.]+)\.php$ /$1 [R=301,L]

# Internally rewrite clean URLs to PHP files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ page-$1.php [L]

# Homepage
RewriteRule ^$ index.php [L]