File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 8
8
// Lấy đường dẫn hiện tại
9
9
var path = window . location . pathname ;
10
10
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 ( / ^ \/ e a s y e n g i n e - n o t e s \/ ? / , "/" ) ;
15
13
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 ;
18
16
19
- console . log ( "Redirecting to:" , newURL ) ; // Debug để kiểm tra
17
+ console . log ( "Redirecting to:" , newURL ) ; // Debug kiểm tra
20
18
19
+ // Thực hiện chuyển hướng
21
20
window . location . replace ( newURL ) ;
22
21
} ;
23
22
</ script >
24
23
</ head >
25
24
< body >
26
25
< p > If you are not redirected, < a id ="redirect-link " href ="# "> click here</ a > .</ p >
27
26
< 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 ( / ^ \/ e a s y e n g i n e - n o t e s \/ ? / , "/" ) ;
29
+ document . getElementById ( "redirect-link" ) . href = "https://easyengine-notes.pages.dev" + path + window . location . search ;
29
30
</ script >
30
31
</ body >
31
32
</ html >
You can’t perform that action at this time.
0 commit comments