Skip to content

Commit

Permalink
Redirect subpages as well
Browse files Browse the repository at this point in the history
  • Loading branch information
dukecat0 authored Dec 5, 2023
1 parent 2ca76d5 commit e8d54c1
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions 404.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0; url='https://pipx.pypa.io'" />
</head>
<body>
<p>You will be redirected to https://pipx.pypa.io soon!</p>
</body>
<head>
<meta http-equiv="refresh" content="5">
</head>
<body>
<script>
var urlObject = new URL(window.location.href);
var pathParts = urlObject.pathname.split("/");
var lastPart = pathParts[pathParts.length - 1];
var redirectUrl = `https://pipx.pypa.io/stable/${lastPart}`;
document.querySelector('meta[http-equiv="refresh"]').content = `5; URL=${redirectUrl}`;
</script>
<p>You will be redirected to https://pipx.pypa.io soon!</p>
</body>
</html>

0 comments on commit e8d54c1

Please sign in to comment.