From 2b1aa1b4c912c11b309a1e9f7876f8921afdd266 Mon Sep 17 00:00:00 2001 From: devaraj3 Date: Sun, 26 Jul 2026 16:02:09 +0530 Subject: [PATCH] feat: add .htaccess for URL rewriting and client-side routing --- public/.htaccess | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 public/.htaccess diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..90d6504 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,15 @@ + +RewriteEngine On + +# If a real file or directory already matches the request, serve it as-is +RewriteCond %{REQUEST_FILENAME} -f [OR] +RewriteCond %{REQUEST_FILENAME} -d +RewriteRule ^ - [L] + +# If appending .html to the request matches a real file, serve that (e.g. /viewer -> viewer.html) +RewriteCond %{REQUEST_FILENAME}.html -f +RewriteRule ^(.*)$ $1.html [L] + +# Otherwise, fall back to the main app shell so client-side routing can show a proper 404 +RewriteRule ^ index.html [L] +