Files
jsonPrism/public/404.html
T

42 lines
1.3 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>JSONPrism</title>
<!--
GitHub Pages serves this file for any unknown path. Because JSONPrism is a
BrowserRouter SPA, a deep-link refresh (e.g. /jsonPrism/about) would 404
here. This script encodes the requested path into a query string and
redirects to the app's index, where a small decoder in index.html restores
the real route. Technique: https://github.com/rafgraph/spa-github-pages
pathSegmentsToKeep = 1 preserves the project-page base segment (/jsonPrism/).
-->
<script type="text/javascript">
var pathSegmentsToKeep = 1;
var l = window.location;
l.replace(
l.protocol +
'//' +
l.hostname +
(l.port ? ':' + l.port : '') +
l.pathname
.split('/')
.slice(0, 1 + pathSegmentsToKeep)
.join('/') +
'/?/' +
l.pathname
.slice(1)
.split('/')
.slice(pathSegmentsToKeep)
.join('/')
.replace(/&/g, '~and~') +
(l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') +
l.hash,
);
</script>
</head>
<body></body>
</html>