Options -Indexes -MultiViews
DirectoryIndex index.php

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Also support clean links if Apache is pointed directly at /public.
    RewriteRule ^q/([A-Za-z0-9_-]+)/?$ index.php [QSA,L]
    RewriteRule ^s/([A-Za-z0-9_-]+)/?$ index.php [QSA,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ index.php [QSA,L]
</IfModule>

# BEGIN MEDCAL PUBLIC SECURITY
Options -Indexes

# Prevent direct requests for accidental backup/source files inside public/.
<FilesMatch "(^\.|\.env$|\.ini$|\.log$|\.sql$|\.sqlite$|\.sqlite3$|\.bak$|\.backup$|\.old$|\.orig$|\.save$|\.swp$|\.zip$|\.tar$|\.tgz$|\.rar$|\.7z$)">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
    </IfModule>
</FilesMatch>
# END MEDCAL PUBLIC SECURITY
