# JOCYT Business Consult website
# If your public_html already has an .htaccess (for example for the JBCS
# dashboard folder), MERGE these lines into it - do not replace it blindly.

Options -Indexes -MultiViews
# index.html is listed so other apps in sub-folders (e.g. the JBCS dashboard, which is a
# single index.html) keep opening - this file applies to every folder below it.
DirectoryIndex index.php index.html
ServerSignature Off

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Never serve dotfiles (.env, .git, .htaccess) - except .well-known
    RewriteRule (^|/)\.(?!well-known/) - [F,L]

    # Never serve backups, dumps or editor leftovers (applies to sub-folders too, on purpose)
    RewriteRule \.(sql|sqlite|db|bak|old|orig|swp|log|ini|sh|tar|gz)$ - [F,L,NC]

    # Existing files and folders (assets, uploads, and any other app such as
    # the JBCS dashboard folder) are served as they are.
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]

    # Everything else goes to the site.
    RewriteRule ^ index.php [L,QSA]
</IfModule>

<IfModule mod_headers.c>
    Header always unset X-Powered-By
</IfModule>
# Long browser caching is set ONLY inside assets/ (see assets/.htaccess). Setting it here
# would also apply to every other app below this folder - e.g. the JBCS dashboard's own
# scripts would then be cached by browsers for a year after each release.

<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml application/javascript application/json application/xml image/svg+xml
</IfModule>
