forked from nrvnm/jkl-pages
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path404.html
More file actions
45 lines (40 loc) · 1.38 KB
/
404.html
File metadata and controls
45 lines (40 loc) · 1.38 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
title: 404
---
<script type="text/javascript">
function endsWith(str, suffix) {
return str.indexOf(suffix, str.length - suffix.length) !== -1;
}
var path = window.location.pathname;
if (endsWith(path, '/index.html')) {
path = path.substring(0, path.length - '/index.html'.length);
}
if (endsWith(path, '/documentation/') ||
endsWith(path, '/gerrit/')) {
path = path.substring(0, path.length - 1);
window.location.pathname = path + ".html"
} else if (endsWith(path, '/')) {
console.log('trailing slash removed from the path: ' + path);
path = path.substring(0, path.length - 1);
window.location.pathname = path;
} else {
console.log('processing not found path: ' + path);
if (path == '/eap' || path == '/eap.html') {
window.location.pathname = '/download.html';
} else if (path == '/stash' || path == '/stash.html') {
window.location.pathname = '/bitbucket.html'
} else if (
endsWith(path, '/gerrit') ||
endsWith(path, '/download') ||
endsWith(path, '/documentation') ||
endsWith(path, '/support') ||
endsWith(path, '/contacts') ||
endsWith(path, '/pricing')) {
window.location.pathname = path + '.html';
} else if (path == '/register' || path == '/register.html') {
window.location.pathname = '/pricing.html';
} else {
window.location.hostname = 'old.subgit.com';
}
}
</script>