From 4ddd61a8464ac1a5857d4dd9dbb9bca995b4be9f Mon Sep 17 00:00:00 2001 From: "Alejandro E. Rendon" Date: Thu, 5 Feb 2026 10:48:39 -0500 Subject: [PATCH 1/4] Refactor routing logic in index.html and simplify HashRouter usage in main.jsx - Updated the redirect script in index.html to handle routing more effectively by preserving the base path and appending the route. - Removed the baseUrl configuration from HashRouter in main.jsx for a cleaner implementation. --- index.html | 12 ++++++++---- src/main.jsx | 4 +--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index c5cea0a..4f15125 100644 --- a/index.html +++ b/index.html @@ -19,10 +19,14 @@ diff --git a/src/main.jsx b/src/main.jsx index fbb77b1..4c8068d 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -4,11 +4,9 @@ import { HashRouter } from "react-router-dom"; import "./index.css"; import App from "./App.jsx"; -const baseUrl = (import.meta.env.BASE_URL ?? "/").replace(/\/$/, "") || undefined; - createRoot(document.getElementById("root")).render( - + , From 1aeb539b0a7e2f0c7b733de39bddda17a8675fb8 Mon Sep 17 00:00:00 2001 From: "Alejandro E. Rendon" Date: Thu, 5 Feb 2026 10:50:00 -0500 Subject: [PATCH 2/4] Refactor index.html and clean up Sponsors component - Changed the function syntax in index.html to an arrow function for consistency. - Simplified the Sponsors component by removing unnecessary line breaks and ensuring a cleaner return statement. --- index.html | 2 +- src/App.jsx | 2 +- src/pages/Sponsors/index.jsx | 8 +++----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 4f15125..fcf6f62 100644 --- a/index.html +++ b/index.html @@ -19,7 +19,7 @@ From 47e24118a3d8ca5a3d9f32480d551704bb4a82fe Mon Sep 17 00:00:00 2001 From: "Alejandro E. Rendon" Date: Thu, 5 Feb 2026 14:43:10 -0500 Subject: [PATCH 4/4] Implement redirect functionality and add 404 page - Moved redirect logic from index.html to a new redirect.js file for better organization and maintainability. - Introduced a 404.html page that utilizes the redirect script for handling non-existent routes. --- index.html | 7 +------ public/404.html | 12 ++++++++++++ public/redirect.js | 8 ++++++++ 3 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 public/404.html create mode 100644 public/redirect.js diff --git a/index.html b/index.html index c5cea0a..85c0dfa 100644 --- a/index.html +++ b/index.html @@ -18,12 +18,7 @@ }); - +
diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000..e4dbf18 --- /dev/null +++ b/public/404.html @@ -0,0 +1,12 @@ + + + + + + Redirecting… + + + +

Redirecting…

+ + diff --git a/public/redirect.js b/public/redirect.js new file mode 100644 index 0000000..86d7308 --- /dev/null +++ b/public/redirect.js @@ -0,0 +1,8 @@ +(() => { + var path = window.location.pathname; + if (path === "/" || path === "") return; + var lastSlash = path.lastIndexOf("/"); + var base = lastSlash <= 0 ? "/" : path.slice(0, lastSlash); + var route = lastSlash <= 0 ? path : path.slice(lastSlash); + window.location.replace(base + "#" + route); +})();