Update 404.md

This commit is contained in:
johndmulhausen
2016-03-17 13:56:03 -07:00
parent 67b23a4a53
commit db2ea256a9
+18 -5
View File
@@ -3,21 +3,35 @@ layout: docwithnav
title: 404 Error! title: 404 Error!
permalink: /404.html permalink: /404.html
--- ---
<script language="JavaScript"> <script language="JavaScript">
$( document ).ready(function() { $( document ).ready(function() {
var oldURLs=[".html",".md","/v1.1/","/v1.0/","/README"]; var oldURLs=["/README.md","/README.html",".html",".md","/v1.1/","/v1.0/"];
var fwdDirs=["examples/"];
var doRedirect = false; var doRedirect = false;
var notHere = false;
var forwardingURL=window.location.href; var forwardingURL=window.location.href;
for (i=0;i<fwdDirs.length;i++) {
if (forwardingURL.indexOf(fwdDirs[i]) > -1)
{
var urlPieces = forwardingURL.split(fwdDirs[i]);
var newURL = "https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/" + fwdDirs[i];
notHere = true;
window.location.replace(newURL);
}
}
if (!notHere) {
for (i=0;i<oldURLs.length;i++) { for (i=0;i<oldURLs.length;i++) {
if (forwardingURL.indexOf(oldURLs[i]) > -1) { if (forwardingURL.indexOf(oldURLs[i]) > -1)
{
doRedirect=true; doRedirect=true;
forwardingURL=forwardingURL.replace(oldURLs[i],"/"); forwardingURL=forwardingURL.replace(oldURLs[i],"/");
} }
} }
if (doRedirect) { if (doRedirect)
{
window.location.replace(forwardingURL); window.location.replace(forwardingURL);
}; };
}
}); });
</script> </script>
@@ -25,4 +39,3 @@ Sorry, this page was not found. :(
You can let us know by filling out the "I wish this page" text field at You can let us know by filling out the "I wish this page" text field at
the bottom of this page. Maybe try: "I wish this page _existed_." the bottom of this page. Maybe try: "I wish this page _existed_."