Files
hamed 97958ecc7d Update Kernel.php for writable base handling, add .htaccess for routing, and modify manifest.json and liara.json
- Refactored Kernel.php to ensure writable base directory is set correctly for production on Liara.
- Added .htaccess file to forward requests to the public directory, addressing the limitation of Liara's PHP platform.
- Updated manifest.json with new modification times and AST hashes for affected files.
- Minor formatting change in liara.json to ensure proper file structure.
2026-06-29 18:24:48 +03:30

23 lines
1.2 KiB
ApacheConf

# Liara's generic PHP platform serves the project root as DocumentRoot and offers
# no way to point it at public/ (only the dedicated "laravel" platform does that
# automatically, but that would run artisan/npm — wrong for Symfony). Symfony's
# recommended setup is DocumentRoot=public/; since that's unavailable here, forward
# every request into public/ and let public/.htaccess route to index.php.
DirectoryIndex public/index.php
<IfModule mod_rewrite.c>
RewriteEngine On
# Block direct external access to the public/ prefix (e.g. /public/index.php).
# Real assets are referenced as /build/... not /public/... . THE_REQUEST holds
# the ORIGINAL request line, so this does NOT match the internal rewrite below.
RewriteCond %{THE_REQUEST} \s/+public/ [NC]
RewriteRule ^ - [R=404,L]
# Forward everything into public/. The negative lookahead (?!public/) stops the
# internal rewrite from looping (public/ -> public/public/...). Anything outside
# public/ (e.g. /.env, /src/...) maps to a non-existent public/<path> and falls
# through to the front controller as a 404 — root files are never served.
RewriteRule ^(?!public/)(.*)$ public/$1 [L]
</IfModule>