RewriteEngine On
AddDefaultCharset UTF-8

Options -Indexes
Options +SymLinksIfOwnerMatch
# Options +SymLinksifOwnerMatch

#RewriteBase /

# Allow harmless files
RewriteCond %{REQUEST_URI} !\.(?:css|js|map|jpe?g|gif|png|svg|webp)$
# Allow file upoad handler
RewriteCond %{REQUEST_URI} !(^|/)imanager/upload/server/php($|/.*$)$
# Block access to any htaccess files
RewriteCond %{REQUEST_URI} (^|/)\.htaccess$ [NC,OR]
# Block access to imanager & editor's directories
RewriteCond %{REQUEST_URI} (^|/)(data|imanager|modules|core|lang|themes.*_.*)($|/.*$)
# If any conditions above match, issue a 403 forbidden
RewriteRule ^.*$ - [F,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^editor/(.*)$ editor/index.php?id=$2 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?id=$1 [L,QSA]