asteroid/.htaccess

23 lines
715 B
ApacheConf
Raw Permalink Normal View History

<IfModule mod_rewrite.c>
2024-09-27 18:55:47 +00:00
RewriteEngine On
RewriteBase /
2024-09-27 18:55:47 +00:00
# Ensure that static files like .js, .css, and service worker are not affected by rewrite rules
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule \.(js|css|png|jpg|jpeg|gif|svg|ico|json|map)$ - [L]
2024-09-27 18:55:47 +00:00
# Ensure service worker is served from the /dist/ folder
RewriteRule ^dist/sw\.js$ - [L]
2024-09-27 18:55:47 +00:00
# For Single Page Application (SPA) routing
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
2024-09-27 18:55:47 +00:00
# Add the correct MIME type for .js and .json files
<IfModule mod_mime.c>
AddType application/javascript .js
AddType application/manifest+json .json
</IfModule>