Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dvho committed Jul 27, 2024
1 parent 7563c38 commit 4c6364b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
23 changes: 19 additions & 4 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,30 @@
<meta charset="UTF-8">
<title>Redirecting...</title>
<script type="text/javascript">
// Preserve the original path and query string
//Function to load the index.html content
function loadIndex() {
var xhr = new XMLHttpRequest();
xhr.open('GET', '/index.html', true);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4 && xhr.status === 200) {
document.open();
document.write(xhr.responseText);
document.close();
}
};
xhr.send();
}

//Preserve the original path, query string, and hash
var path = window.location.pathname;
var query = window.location.search;
var hash = window.location.hash;

// Redirect to index.html but keep the original path, query, and hash
var newUrl = '/index.html' + query + hash;
// Load the index.html content
loadIndex();

// Update the browser's address bar to the original path
history.replaceState(null, '', path + query + hash);
window.location.replace(newUrl);
</script>
</head>
<body>
Expand Down
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

0 comments on commit 4c6364b

Please sign in to comment.