Skip to content

Commit 7bf21b4

Browse files
author
louiiuol
committed
[CI] Update 404 script
1 parent c08e0ac commit 7bf21b4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/assets/404.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22
<html lang="en">
33
<head>
44
<title>ngx lib - Not Found - Redirecting</title>
5-
<meta http-equiv="refresh" content="0; URL='./index.html'" />
5+
<meta http-equiv="refresh" content="0; URL='/ngx-lib/'" />
66
<script type="text/javascript">
7-
console.log(window.location.pathname);
8-
window.location.href = "./index.html" + window.location.pathname;
7+
// Check if the current path isn't the root ("/ngx-lib/")
8+
if (window.location.pathname !== "/ngx-lib/") {
9+
alert(window.location.pathname);
10+
// Redirect the user back to the index page while preserving the original route
11+
window.location.replace(
12+
"/ngx-lib/" + window.location.pathname.substring(1),
13+
);
14+
}
915
</script>
1016
</head>
1117
<body></body>

0 commit comments

Comments
 (0)