Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ZestyTS committed Sep 19, 2024
1 parent 74ad610 commit 7903e2b
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,27 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="refresh" content="0;url=/UWUVCI-Website/">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Page Not Found</title>
</head>
<body>
<h1>Page Not Found</h1>
<p>Redirecting you back to the homepage...</p>
<script>
// Get the full URL
const currentPath = window.location.pathname;
// Extract the current path
let currentPath = window.location.pathname;

// Make sure you're only adding the base path once
if (!currentPath.includes('/UWUVCI-Website/')) {
window.location.href = '/UWUVCI-Website/';
// Remove the base path (in this case /UWUVCI-Website) from the current path
const basePath = '/UWUVCI-Website';
if (currentPath.startsWith(basePath)) {
currentPath = currentPath.substring(basePath.length);
}

// Redirect to the correct path by appending to the base path
if (currentPath) {
window.location.replace(`${basePath}${currentPath}`);
} else {
window.location.href = '/UWUVCI-Website/#' + currentPath;
// If no valid path, redirect to the home page
window.location.replace(basePath);
}
</script>
</body>
Expand Down

0 comments on commit 7903e2b

Please sign in to comment.