<ifmodule mod_rewrite.c>
RewriteEngine on
RewriteBase /

#Following line is required in Server to set Basic Auth Parameters in FastCGI Environment
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

#Match any query string (including an empty one).
RewriteCond %{QUERY_STRING} ^(.*)$

# Ensure the request is not for an existing file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Exclude cPanel and Comodo DCV paths
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$

# Resize images as per required resolution
RewriteRule ^img-([0-9]+)/([A-Za-z0-9/_-]+).(jpeg|jpg|gif|png)$ project/script/img-resize.php?max_width=$1&imgpath=$2.$3

RewriteRule api/(.*)$ api/rest/api.php?request=$1 [QSA,NC,L]
</ifmodule>