Skip to content

Commit ff6a188

Browse files
committed
Update 404.html
1 parent 6363c1a commit ff6a188

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

404.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,18 @@
8181
return window.location.pathname.match(/^\/repo\/.+/);
8282
}
8383

84-
// Redirect repository paths to the home page for dynamic loading
84+
// If this is a repository path, check format and handle accordingly
8585
if (isRepoPath()) {
8686
const path = window.location.pathname;
87-
window.location.replace('/' + '?repo_path=' + encodeURIComponent(path));
87+
const pathMatch = path.match(/\/repo\/([^\/]+)\/([^\/]+)\/([^\/]+)\/?$/);
88+
89+
if (pathMatch) {
90+
// Valid repository path format - direct navigate to maintain clean URL
91+
window.location.href = path;
92+
} else {
93+
// Invalid repository path format - redirect to home page
94+
window.location.replace('/');
95+
}
8896
}
8997
</script>
9098
</head>

0 commit comments

Comments
 (0)