DirectoryIndex /deliver.php
#php_value upload_max_filesize 10M #php_value post_max_size 13M
RewriteEngine On
RewriteCond %{HTTP_HOST} !=localhost RewriteCond %{HTTP_HOST} !=127.0.0.1 RewriteCond %{REMOTE_ADDR} !=127.0.0.1 RewriteCond %{REMOTE_ADDR} !=::1 RewriteCond %{HTTPS} off
First rewrite to HTTPS:
Don't put www. here. If it is already there it will be included, if not
the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_URI} !^/deliver.php$ RewriteRule (.+) /deliver.php [L,QSA]