mirror of
https://github.com/n8n-io/n8n-docs.git
synced 2026-03-27 09:28:43 +07:00
45 lines
1.3 KiB
HTML
45 lines
1.3 KiB
HTML
{% extends "main.html" %}
|
|
{% block htmltitle %}
|
|
<title>404</title>
|
|
{% endblock %}
|
|
{% block extrahead %}
|
|
<script>
|
|
// Create an object containing redirects to headings
|
|
const redirects = {
|
|
|
|
};
|
|
|
|
(function redirect(){
|
|
const incomingPath = window.location.pathname;
|
|
const hasExtension = /\.[a-zA-Z0-9]+$/.test(incomingPath);
|
|
|
|
// handle uppercase URLs
|
|
if (incomingPath !== incomingPath.toLowerCase()) {
|
|
const lowercasePath = incomingPath.toLowerCase();
|
|
window.location.href = `${window.location.origin}${lowercasePath}`;
|
|
return;
|
|
}
|
|
|
|
// handle missing trailing `/`
|
|
if (!incomingPath.endsWith('/') && !hasExtension) {
|
|
window.location.href = `${window.location.origin}${incomingPath}/`;
|
|
return;
|
|
}
|
|
|
|
|
|
|
|
// handle redirects for headings
|
|
const currentPath = incomingPath + (window.location.hash ? window.location.hash : '');
|
|
const redirectUrl = redirects[currentPath];
|
|
if (redirectUrl) {
|
|
window.location.href = `${window.location.origin}${redirectUrl}`;
|
|
return;
|
|
}
|
|
})();
|
|
|
|
</script>
|
|
{% endblock %}
|
|
{% block content %}
|
|
<h1>404 - Page not found</h1>
|
|
<h2>Go <a href="/">home</a></h2>
|
|
{% endblock %} |