Skip to content

Commit 06e3eff

Browse files
authored
Update script.js
1 parent 72a9e8f commit 06e3eff

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

script.js

+10
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,13 @@ window.onerror = function (message, source, lineno, colno, error) {
2727
}
2828
return true; // Prevents the default browser error page
2929
};
30+
31+
// Default error handler: redirect to an error page based on HTTP status code
32+
window.onload = function() {
33+
if (document.title === "404 - Page Not Found") {
34+
window.location.href = "404.html";
35+
} else if (document.title === "505 - HTTP Version Not Supported") {
36+
window.location.href = "505.html";
37+
}
38+
// Add more conditions as needed...
39+
};

0 commit comments

Comments
 (0)