Skip to content

Commit

Permalink
trying new restricted methods
Browse files Browse the repository at this point in the history
  • Loading branch information
aakashdinkarh committed Oct 13, 2024
1 parent 0cb873b commit 8871887
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<script type="text/javascript">
var pathSegmentsToKeep = 1;

// var maxRedirects = 1;
// var redirectCount = parseInt(sessionStorage.getItem('redirects')) || 0;
// if (redirectCount >= maxRedirects) {
// sessionStorage.removeItem('redirects');
// document.body.innerHTML = "<h1>404 Not Found</h1><p>The page you are looking for doesn't exist.</p>";
// return;
// }

var maxRedirects = 2;
var redirectCount = parseInt(sessionStorage.getItem('redirects')) || 0;
if (redirectCount >= maxRedirects) {
sessionStorage.removeItem('redirects');
document.body.innerHTML = "<h1>404 Not Found</h1><p>The page you are looking for doesn't exist.</p>";
return;
}
sessionStorage.setItem('redirects', ++redirectCount);
var l = window.location;
l.replace(
l.protocol +
Expand Down

0 comments on commit 8871887

Please sign in to comment.