-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathredirect_script.js
30 lines (30 loc) · 1011 Bytes
/
redirect_script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
DOC REDIRECTS
Performs redirect on the error page after HC detects doc is missing.
Place in the document ready block.
*/
(function(){
var error_page_class = document.getElementsByClassName('error-page');
if (error_page_class.length > 0) {
var url = window.location.href;
var this_hc = 'support.zendesk.com';
var articles = {
200625646: {hc: this_hc, id: 360000355328},
200937457: {hc: 'help.zendesk.com', id: 206223868},
205777498: {hc: 'help.zendesk.com', id: 360001994188},
206416187: {hc: 'help.zendesk.com', id: 360002014167},
206494147: {hc: 'help.zendesk.com', id: 360002014147},
213550488: {hc: 'help.zendesk.com', id: 360001994168}
};
for (var article in articles) {
if (url.indexOf(article) !== -1) {
url = url.replace(article, articles[article].id);
var hc = articles[article].hc;
if (this_hc !== hc) {
url = url.replace(this_hc, hc);
}
location.href = url;
}
}
}
})();