Redirect non-existing links to Overleaf page

This commit is contained in:
yu-i-i
2024-12-03 16:40:27 +01:00
parent 25577379fc
commit 1c499496c6
2 changed files with 5 additions and 1 deletions

View File

@@ -1265,6 +1265,10 @@ async function initialize(webRouter, privateApiRouter, publicApiRouter) {
TokenAccessController.grantTokenAccessReadOnly
)
webRouter.get(['/learn*', '/blog*', '/latex*', '/for/*', '/contact*'], (req, res) => {
res.redirect(301, `https://www.overleaf.com${req.originalUrl}`)
})
webRouter.get('/unsupported-browser', renderUnsupportedBrowserPage)
webRouter.get('*', ErrorController.notFound)

View File

@@ -10,7 +10,7 @@ export default function HotkeysModalBottomText() {
// eslint-disable-next-line jsx-a11y/anchor-has-content, react/jsx-key
<a
onClick={() => eventTracking.sendMB('left-menu-hotkeys-template')}
href="/articles/overleaf-keyboard-shortcuts/qykqfvmxdnjf"
href="https://www.overleaf.com/latex/templates/overleaf-keyboard-shortcuts/pphdnzrwmttk"
target="_blank"
/>,
]}