forked from rmbinformatica/ajuda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path404.html
54 lines (42 loc) · 1.19 KB
/
404.html
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
46
47
48
49
50
51
52
53
54
---
layout: home
---
<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>
<div class="container">
<h1>404</h1>
<p><strong>Página não encontrada :(</strong></p>
<p>A página solicitada não foi encontrada. <div id="novolink"></div></p>
</div>
<script>
// Obter o url acessado
var url = window.location.href;
// Remover o /ajuda/ do url
var novoUrl = url.replace("/ajuda/", "/");
// Selecionar a div novolink
var div = document.getElementById("novolink");
if (url.includes("/ajuda/")) {
div.innerHTML = "Algumas de nossas páginas mudaram de endereço, verifique a página desejada é: <a href='" + novoUrl + "'>" + novoUrl + "</a>";
/*// Criar um elemento a
var a = document.createElement("a");
// Atribuir o novo url como o atributo href do elemento a
a.href = novoUrl;
// Atribuir o texto do link como o conteúdo do elemento a
a.textContent = novoUrl;
// Reescrever na página o novo url correto como um link
div.innerHTML = "";
div.appendChild(a);*/
window.location.replace(novoUrl);
}
</script>