Skip to content

Commit

Permalink
Merge pull request #170 from ipfs/fix/redirect-loop
Browse files Browse the repository at this point in the history
fix: remove JS redirect that causes loop
  • Loading branch information
lidel committed Feb 1, 2023
2 parents 3bfe854 + a2edcb8 commit de7ed2b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
9 changes: 1 addition & 8 deletions static/ipfs/ipfs-404.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
<!doctype html><html lang="en-US">
<head>
<script>
// if someone tries to open a gateway path on .tech, redirect to .io
const { hostname, pathname, href: url } = window.location
if (hostname === 'ipfs.tech' && (pathname.startsWith('/ipns/') || pathname.startsWith('/ipfs/'))) {
window.location.replace(url.replace('//ipfs.tech/', '//ipfs.io/'))
}
</script>
</head>
<body>
<h1>Not a gateway :-)</h1>
<p>Try one of the <a href="https://ipfs.github.io/public-gateway-checker/">public gateways</a> instead.</p>
<p>Try loading this path from one of the <a href="https://ipfs.github.io/public-gateway-checker/">public gateways</a> instead.</p>
</body>
9 changes: 1 addition & 8 deletions static/ipns/ipfs-404.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
<!doctype html><html lang="en-US">
<head>
<script>
// if someone tries to open a gateway path on .tech, redirect to .io
const { hostname, pathname, href: url } = window.location
if (hostname === 'ipfs.tech' && (pathname.startsWith('/ipns/') || pathname.startsWith('/ipfs/'))) {
window.location.replace(url.replace('//ipfs.tech/', '//ipfs.io/'))
}
</script>
</head>
<body>
<h1>Not a gateway :-)</h1>
<p>Try one of the <a href="https://ipfs.github.io/public-gateway-checker/">public gateways</a> instead.</p>
<p>Try loading this path from one of the <a href="https://ipfs.github.io/public-gateway-checker/">public gateways</a> instead.</p>
</body>

0 comments on commit de7ed2b

Please sign in to comment.