Skip to content

Commit

Permalink
fix: attempt to fix 404 issue when reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
bolinocroustibat committed Dec 3, 2024
1 parent 565d9d0 commit 6edda3e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions frontend/public/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Redirecting...</title>
<script>
// Get the current path excluding the base URL
const segment = window.location.pathname.replace('/terrains-connus/', '');
// Redirect to the main app with the correct path
window.location.replace('/terrains-connus/#/' + segment);
</script>
</head>
<body>
Redirecting...
</body>
</html>
4 changes: 2 additions & 2 deletions frontend/src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { createRouter, createWebHistory } from "vue-router";
import { createRouter, createWebHashHistory } from "vue-router";
import MapView from "../views/MapView.vue";
import QuestionsView from "../views/QuestionsView.vue";
import TableauView from "../views/TableauView.vue";

const router = createRouter({
history: createWebHistory("/terrains-connus/"),
history: createWebHashHistory("/terrains-connus/"),
routes: [
{
path: "/",
Expand Down

0 comments on commit 6edda3e

Please sign in to comment.