AddDefaultCharset utf-8

RewriteEngine On
Options -Indexes
Options +FollowSymlinks
RewriteBase /

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{REQUEST_URI} !^\/templates/
RewriteCond %{REQUEST_URI} !^\/services/
RewriteCond %{REQUEST_URI} !^\/ajax/(.*).php

RewriteCond %{REQUEST_URI} !^\/modules/[a-z]*/ajax/(.*).php
RewriteCond %{REQUEST_URI} !^\/modules/[a-z]*/cli/(.*).php

RewriteRule ^(.*)$ index.php [NC,L]