From b58c93bb4072b09b499d0a795ff374fdf7b5fd66 Mon Sep 17 00:00:00 2001 From: John Mulhausen Date: Thu, 29 Sep 2016 19:39:14 -0700 Subject: [PATCH] Fixes for forwarding, custom 404 --- 404.md | 7 +++++-- _layouts/docs.html | 3 ++- sorry.md | 29 +++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 sorry.md diff --git a/404.md b/404.md index 4b21aaf69a..e6c5fb1aab 100644 --- a/404.md +++ b/404.md @@ -1,4 +1,5 @@ --- +layout: null permalink: /404.html --- @@ -16,10 +17,12 @@ function doFwd() { console.log(domainName + ":"+ portNumber +"/{{ item[0] }}"); gonnaFwd = true; - if(forwardingURL.indexOf(":")>-1) { + if(portNumber.length > 0) { + console.log("Port!"); // there is a port number in the location; make sure to replace it newURL = forwardingURL.replace(domainName + ":"+ portNumber +"/{{ item[0] }}","{{ page.archiveserver }}:{{ item[1].ports[0] | replace:':4000','' }}"); } else { + console.log("No port"); // no port number in the location; just foward them on newURL = forwardingURL.replace(domainName + "/{{ item[0] }}","{{ page.archiveserver }}:{{ item[1].ports[0] | replace:':4000','' }}"); } @@ -29,7 +32,7 @@ function doFwd() { console.log("Forwarding to: " + newURL); window.location.replace(newURL); } else { - document.getElementById("DocumentationText").innerHTML = "

404

Sorry, we can't find that page. Feel free to file a ticket and let us know!"; + window.location.replace("/sorry/#" + forwardingURL); } } window.onload = doFwd; diff --git a/_layouts/docs.html b/_layouts/docs.html index 5a354d5e0a..0ec1294b47 100644 --- a/_layouts/docs.html +++ b/_layouts/docs.html @@ -192,6 +192,7 @@ ng\:form {
{{ content }} + {% if page.noratings != true %}
chat icon Feedback? Questions? Suggestions?
@@ -207,8 +208,8 @@ ng\:form { }; (function(d,c,j){if(!document.getElementById(j)){var pd=d.createElement(c),s;pd.id=j;pd.src=('https:'==document.location.protocol)?'https://polldaddy.com/js/rating/rating.js':'http://i0.poll.fm/js/rating/rating.js';s=document.getElementsByTagName(c)[0];s.parentNode.insertBefore(pd,s);}}(document,'script','pd-rating-js')); -
+ {% endif %}
+ +
+ +We tried to forward you to where we think you might be going, but we couldn't +find a good match. + +