Skip to content

Commit 064df91

Browse files
authored
Update index.html
1 parent 80539e5 commit 064df91

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

index.html

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,25 @@
88
// Lấy đường dẫn hiện tại
99
var path = window.location.pathname;
1010

11-
// Loại bỏ phần "/easyengine-notes" nếu nó đứng ở đầu
12-
if (path.startsWith("/easyengine-notes")) {
13-
path = path.replace("/easyengine-notes", "");
14-
}
11+
// Loại bỏ mọi lần xuất hiện của "/easyengine-notes" ở đầu URL
12+
var fixedPath = path.replace(/^\/easyengine-notes\/?/, "/");
1513

16-
// Tạo URL đích
17-
var newURL = "https://easyengine-notes.pages.dev" + path + window.location.search;
14+
// Tạo URL đích đúng
15+
var newURL = "https://easyengine-notes.pages.dev" + fixedPath + window.location.search;
1816

19-
console.log("Redirecting to:", newURL); // Debug để kiểm tra
17+
console.log("Redirecting to:", newURL); // Debug kiểm tra
2018

19+
// Thực hiện chuyển hướng
2120
window.location.replace(newURL);
2221
};
2322
</script>
2423
</head>
2524
<body>
2625
<p>If you are not redirected, <a id="redirect-link" href="#">click here</a>.</p>
2726
<script>
28-
document.getElementById("redirect-link").href = "https://easyengine-notes.pages.dev" + window.location.pathname.replace("/easyengine-notes", "") + window.location.search;
27+
// Cập nhật liên kết fallback
28+
var path = window.location.pathname.replace(/^\/easyengine-notes\/?/, "/");
29+
document.getElementById("redirect-link").href = "https://easyengine-notes.pages.dev" + path + window.location.search;
2930
</script>
3031
</body>
3132
</html>

0 commit comments

Comments
 (0)