<IfModule mod_rewrite.c>
    RewriteEngine On

    AddDefaultCharset UTF-8

    Options -Indexes
    Options +SymLinksIfOwnerMatch
    # Options +SymLinksifOwnerMatch

    # RewriteBase /

    # Redirecting HTTP to HTTPS
    # RewriteCond %{SERVER_PORT} 80
    # RewriteRule ^(.*)$ https://your-website.com/$1 [R,L]
    
    # Allow harmless files
    RewriteCond %{REQUEST_URI} !\.(?:css|js|map|jpe?g|gif|png|svg|webp)$
    # Allow file upload handler
    RewriteCond %{REQUEST_URI} !(^|/)imanager/upload/server/php($|/.*$)$

    # Block some directories and files
    RewriteCond %{REQUEST_URI} (^|/)(boot|imanager)(.php$) [NC,OR]
    # Block access to certain native Scriptor files.
    RewriteCond %{REQUEST_URI} (^|/)(.htaccess|data|imanager|modules|core|lang|_.*)($|/.*$) [NC,OR]
    # Forbid access to all directories and files that start with a dot
    RewriteCond %{REQUEST_URI} (^|/)\.[^/]*($|/.*$)

    RewriteRule ^ - [F,L]

    # Block access to .zip, .pdf, and .tar files under "/data/uploads/"
    #RewriteCond %{REQUEST_URI} /data/uploads/.*\.(zip|pdf|tar)$ [NC]
    #RewriteRule ^ - [F,L]

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

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