RewriteEngine On

RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/index.php$

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

RewriteCond %{REQUEST_URI} !^/index.php$
RewriteCond %{REQUEST_URI} !\.

RewriteRule ^(.*)$ $1.php

ErrorDocument 403 /index.php
ErrorDocument 404 /index.php
ErrorDocument 500 /index.php