RewriteEngine On
RewriteBase /E31230887/
# 1. Handle Storage (Internal Rewrite)
# Mapping /storage/... ke /public/storage/... secara internal
RewriteRule ^storage/(.*)$ public/storage/$1 [L]
# 2. Handle Other Static Assets (img, build, images, favicon, robots.txt)
# Menghindari redirect R=302 agar URL tetap bersih tanpa /public/
RewriteCond %{REQUEST_URI} !^/E31230887/public/
RewriteRule ^(img|build|images|favicon\.ico|robots\.txt)(.*)$ public/$1$2 [L]
# 3. Handle Laravel Front Controller
# Jika file fisik tidak ada, lempar ke index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
Options -Indexes
Order allow,deny
Deny from all