Skip to content

Commit

Permalink
✨ update script to not begin looping
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfiSlask committed Jun 19, 2024
1 parent 121d0c3 commit f664f05
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
19 changes: 0 additions & 19 deletions 404.html

This file was deleted.

14 changes: 10 additions & 4 deletions public/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@
<title>Page Not Found</title>
<script>
(() => {
const base = '/the-webshop-RalfiSlask';
const path = window.location.pathname;
const newPath = '/the-webshop-RalfiSlask/' + path;
window.location.replace(newPath);
if (!path.startsWith(base)) {
const newPath = base + path;
window.location.replace(newPath);
} else {
document.querySelector('h1').textContent = 'Page Not Found';
document.querySelector('p').textContent = 'The page you are looking for does not exist.';
}
})();
</script>
</head>
<body>
<h1>Page Not Found</h1>
<p>Redirecting...</p>
<h1>Redirecting...</h1>
<p>Please wait...</p>
</body>
</html>

0 comments on commit f664f05

Please sign in to comment.