Options +FollowSymlinks
Options -Indexes
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*) index.php [QSA,L]
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteCond %{REMOTE_HOST} !^xxx\.xxx\.xxx\.xxx
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^mysite.ru$ [NC]
RewriteRule ^(.*)$ https://mysite.ru/$1 [L,R=301]