# Route any request for a file/directory that doesn't actually exist to our
# custom 404 page. We deliberately do NOT use "ErrorDocument 404 /404.php"
# because that absolute path is relative to the domain root, not to wherever
# this project folder is deployed — it would break in a subfolder install
# (e.g. https://example.com/mess-system/) the same way BASE_URL had to be
# auto-detected elsewhere in this project. A RewriteRule target without a
# leading slash is resolved relative to this .htaccess's own directory
# instead, so this works whether the app sits at the domain root or in any
# subfolder, with zero configuration.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ 404.php [L]
