Options -Indexes
RewriteEngine On
RewriteBase /

# RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
# RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

# RewriteCond %{HTTPS} off
# RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

ErrorDocument 400 /index.php
ErrorDocument 401 /index.php
ErrorDocument 403 /index.php
ErrorDocument 404 /index.php
ErrorDocument 500 /index.php

# Check if the requested file does not exist
RewriteRule ^public/assets/@(.*?)/(.*) /include/Module/$1/Assets/$2 [L]
RewriteRule ^public/assets/([A-Z][a-z]+)/(.*) /include/Module/$1/Assets/$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^public/assets(.*)$ /include/buildin$1 [NC,L,QSA]

RewriteCond %{REQUEST_FILENAME} !\.(css|js|svg|jpg|png|ttf|woff2|webp|webv|gif|webmanifest|txt|map)$ [NC]
RewriteRule ^ index.php [NC,L,QSA]