-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.htaccess
More file actions
37 lines (28 loc) · 1.07 KB
/
.htaccess
File metadata and controls
37 lines (28 loc) · 1.07 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
35
# Set proper MIME types for JavaScript modules
<IfModule mod_mime.c>
AddType application/javascript .js
AddType text/css .css
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Redirect all requests for the API to api/index.php
RewriteRule ^api/?$ api/index.php [L]
RewriteRule ^api/(.*)$ api/index.php [L]
# Serve built admin SPA assets directly
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Serve admin assets (JS, CSS, etc.) directly from dist folder
RewriteCond %{REQUEST_URI} ^/admin/assets/
RewriteRule ^admin/assets/(.*)$ admin/dist/assets/$1 [L]
# Fallback to admin/dist/index.html for admin routes
RewriteCond %{REQUEST_URI} ^/admin/
RewriteRule ^admin/(.*)$ admin/dist/index.html [L]
# Serve existing files directly
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Fallback for front controllers (admin/widget later)
RewriteRule . index.php [L]
</IfModule>