AddDefaultCharset UTF-8

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Always use the non-www domain
    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
    
    # Always use https
    #RewriteCond %{SERVER_PORT} 80 
    #RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^restapi\.(.*)$ [NC]
    RewriteRule ^(.*)$ rest.php?_url=/$1 [QSA,L]
  
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
</IfModule>

<IfModule mod_alias.c>
    RedirectMatch 403 favicon.ico
</IfModule>