Skip to content

Commit db2ea25

Browse files
Update 404.md
1 parent 67b23a4 commit db2ea25

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

404.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,39 @@ layout: docwithnav
33
title: 404 Error!
44
permalink: /404.html
55
---
6-
76
<script language="JavaScript">
87
$( document ).ready(function() {
9-
var oldURLs=[".html",".md","/v1.1/","/v1.0/","/README"];
10-
var doRedirect=false;
8+
var oldURLs=["/README.md","/README.html",".html",".md","/v1.1/","/v1.0/"];
9+
var fwdDirs=["examples/"];
10+
var doRedirect = false;
11+
var notHere = false;
1112
var forwardingURL=window.location.href;
12-
for (i=0;i<oldURLs.length;i++) {
13-
if (forwardingURL.indexOf(oldURLs[i]) > -1) {
14-
doRedirect=true;
15-
forwardingURL=forwardingURL.replace(oldURLs[i],"/");
13+
for (i=0;i<fwdDirs.length;i++) {
14+
if (forwardingURL.indexOf(fwdDirs[i]) > -1)
15+
{
16+
var urlPieces = forwardingURL.split(fwdDirs[i]);
17+
var newURL = "https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/" + fwdDirs[i];
18+
notHere = true;
19+
window.location.replace(newURL);
20+
}
21+
}
22+
if (!notHere) {
23+
for (i=0;i<oldURLs.length;i++) {
24+
if (forwardingURL.indexOf(oldURLs[i]) > -1)
25+
{
26+
doRedirect=true;
27+
forwardingURL=forwardingURL.replace(oldURLs[i],"/");
28+
}
1629
}
30+
if (doRedirect)
31+
{
32+
window.location.replace(forwardingURL);
33+
};
1734
}
18-
if (doRedirect) {
19-
window.location.replace(forwardingURL);
20-
};
2135
});
2236
</script>
2337

2438
Sorry, this page was not found. :(
2539

2640
You can let us know by filling out the "I wish this page" text field at
2741
the bottom of this page. Maybe try: "I wish this page _existed_."
28-

0 commit comments

Comments
 (0)