Skip to content

Commit

Permalink
user-guide: add HTTP redirect from err.dvc.org/{header} to troublesho…
Browse files Browse the repository at this point in the history
…oting guide header

per #875 (comment)
  • Loading branch information
jorgeorpinel committed Jan 10, 2020
1 parent 775ea17 commit d2293b5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ app.prepare().then(() => {
: pathname)
})
res.end()
} else if (req.headers.host === 'err.dvc.org') {
// err.dvc.org/{hdr} -> dvc.org/doc/user-guide/troubleshooting#{hdr},
res.writeHead(301, {
'Cache-Control': 'no-cache',
Location: `https://dvc.org/doc/user-guide/troubleshooting#${pathname}`
})
res.end()
} else if (/^(code|data|remote)\.dvc\.org$/.test(req.headers.host)) {
// {code/data/remote}.dvc.org -> corresponding S3 bucket
res.writeHead(301, {
Expand Down

0 comments on commit d2293b5

Please sign in to comment.