File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -21,12 +21,31 @@ watch(
21
21
() => page .value .isNotFound ,
22
22
(isNotFound ) => {
23
23
if (! isNotFound || ! inBrowser ) return
24
+
25
+ console .log (' [Layout 404] Checking redirects for:' , window .location .pathname )
24
26
const redirect = redirects .find (([from ]) => window .location .pathname .startsWith (from ))
25
- if (! redirect ) return
27
+
28
+ if (! redirect ) {
29
+ console .log (' [Layout 404] No redirect found for:' , window .location .pathname )
30
+ return
31
+ }
32
+
26
33
const newPath = redirect [1 ] + window .location .pathname .slice (redirect [0 ].length )
27
34
const search = window .location .search
28
35
const hash = window .location .hash
29
- go (newPath + search + hash )
36
+ const fullNewUrl = newPath + search + hash
37
+
38
+ console .log (' [Layout 404] Redirect found:' , {
39
+ from: redirect [0 ],
40
+ to: redirect [1 ],
41
+ originalPath: window .location .pathname ,
42
+ newPath ,
43
+ search ,
44
+ hash ,
45
+ fullNewUrl
46
+ })
47
+
48
+ go (fullNewUrl )
30
49
},
31
50
{ immediate: true }
32
51
)
You can’t perform that action at this time.
0 commit comments