diff --git a/package.json b/package.json index cbe066d..2dbfd46 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "watch": "ng build --watch --configuration development", "test": "ng test", "lint": "biome lint --write src", - "format": "biome format --write src" + "format": "biome format --write src", + "postbuild": "cp src/.htaccess dist/" }, "private": true, "dependencies": { diff --git a/src/.htaccess b/src/.htaccess new file mode 100644 index 0000000..75aecb3 --- /dev/null +++ b/src/.htaccess @@ -0,0 +1,6 @@ + + RewriteEngine On # Redirection of requests to index.html RewriteCond + %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR] RewriteCond + %{DOCUMENT_ROOT}%{REQUEST_URI} -d RewriteRule ^.*$ - [NC,L] # Redirect all + non-file routes to index.html RewriteRule ^(?!.*\.).*$ index.html [NC,L] +