-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy path.htaccess
More file actions
34 lines (26 loc) · 1.17 KB
/
Copy path.htaccess
File metadata and controls
34 lines (26 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Raiz (/) – redireciona diretamente para /login (evita 404)
RewriteRule ^/?$ /login [R=302,L]
# /storage/* – arquivo local via symlink, se existir
RewriteCond %{DOCUMENT_ROOT}/public/storage/$1 -f
RewriteRule ^storage/(.*)$ public/storage/$1 [L]
# /storage/* – fallback Laravel (StorageServeController)
RewriteRule ^storage/ public/index.php [L]
# /build/* – servir de public/build/ (assets Vite)
RewriteRule ^build/(.*)$ public/build/$1 [L]
# /images/* – servir de public/images/
RewriteRule ^images/(.*)$ public/images/$1 [L]
# PWA: manifest dinâmico via Laravel (White Label)
RewriteRule ^manifest\.json$ public/index.php [L]
RewriteRule ^painel-sw\.js$ public/painel-sw.js [L]
RewriteRule ^icons/(.*)$ public/icons/$1 [L]
# Arquivos/diretórios existentes – não reescrever
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Demais requisições – encaminhar para o Laravel
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ public/index.php [L,QSA]
</IfModule>