Skip to content

Commit

Permalink
Create 404.html with automatic redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
nfriedly committed Aug 20, 2023
1 parent dd73fcd commit 043c924
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<noscript>
<meta
http-equiv="refresh"
content="0; url=https://github.com/express-rate-limit/express-rate-limit"
/>
</noscript>
<script type="text/javascript">
// default redirection target
let target = 'https://github.com/express-rate-limit/express-rate-limit'
// strip the leading and trailing slashes and lowercase
let path = location.pathname.substr(1).toLowerCase();
if (path.endsWith('/')) {
path = path.substring(0, path.length-1)
}
if (path.startsWith('err_erl_') || target.startsWith('wrn_erl_')) {
target += '/wiki/Error-Codes#' + target;
}
document.addEventListener("DOMContentLoaded", (event) => {
document.getElementById('link').href=target;
});
window.location.href = target;
</script>
<title>Page Redirection</title>
</head>
<body>
If you are not redirected automatically, follow
<a id="link"
href="https://github.com/express-rate-limit/express-rate-limit"
>
this link
</a>
to the Express Rate Limit page.
</body>
</html>

0 comments on commit 043c924

Please sign in to comment.