forked from lapikud/lapikud.github.io
Add 404 page with trailing slash redirect
This commit is contained in:
19
404.html
Normal file
19
404.html
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
title: 404 - Page not found
|
||||||
|
---
|
||||||
|
|
||||||
|
<div class="page">
|
||||||
|
<h1>Sorry, this page doesn't exist.</h1>
|
||||||
|
<h1>(404 error)</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// on 2016-02-01 GitHub Pages upgraded to Jekyll3, which broke all blog posts with trailing slashes
|
||||||
|
// and there are tons of links out there on the web to posts with a trailing slash, so can't ignore it
|
||||||
|
// Fix borrowed from https://github.com/daattali/daattali.github.io/blob/master/404.html#L14-L21
|
||||||
|
var url = location.href;
|
||||||
|
if(url.substr(url.length - 1) === '/') {
|
||||||
|
window.location = url.substr(0, url.length - 1);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user