redirect old links
This commit is contained in:
parent
123161be22
commit
123d7d814b
18
404.html
18
404.html
|
@ -22,4 +22,22 @@ layout: default
|
|||
|
||||
<p><strong>Page not found :(</strong></p>
|
||||
<p>The requested page could not be found.</p>
|
||||
<p>This website only keeps articles from the last few days, so if you landed here from a link, it's likely that the article is no longer available. This page will automatically redirect to Beatroot News in such cases.</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Get the current pathname
|
||||
var currentPath = window.location.pathname;
|
||||
|
||||
// Extract the integer from the pathname using regular expressions
|
||||
var match = currentPath.match(/\/(\d+)\//);
|
||||
|
||||
// Check if a match is found and the matched string is an integer
|
||||
if (match && !isNaN(match[1])) {
|
||||
// Extract the integer value
|
||||
var integer = match[1];
|
||||
|
||||
// Redirect the user to the desired URL
|
||||
window.location.href = `https://app.beatrootnews.com/#article-${integer}`;
|
||||
}
|
||||
</script>
|
2
TODO.md
2
TODO.md
|
@ -9,7 +9,7 @@
|
|||
- [ ] Highlight words
|
||||
- [ ] Font adjustments
|
||||
- [ ] Clear "read articles"
|
||||
- [ ] Redirect 404 articles to upstream
|
||||
- [x] Redirect 404 articles to upstream
|
||||
- [ ] Add sign for "developing story"
|
||||
- [ ] Fix tap target size in bottom footer.
|
||||
- [ ] Make "/" in bottom footer using CSS after
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
env: production
|
Loading…
Reference in New Issue