Skip to content

Commit

Permalink
Try out redirects again
Browse files Browse the repository at this point in the history
  • Loading branch information
ismayc committed Sep 21, 2024
1 parent c7e1e00 commit 6917942
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
15 changes: 15 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0; url=https://moderndive-v2.netlify.app">
<script type="text/javascript">
var hash = window.location.hash;
if (window.location.pathname === "/v2" || window.location.pathname.startsWith("/v2/")) {
window.location.href = "https://moderndive-v2.netlify.app" + hash;
}
</script>
</head>
<body>
<p>If you are not redirected automatically, follow this <a href="https://moderndive-v2.netlify.app">link to ModernDive V2</a>.</p>
</body>
</html>
1 change: 1 addition & 0 deletions _redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/v2 https://moderndive-v2.netlify.app 301!
3 changes: 3 additions & 0 deletions index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ if (!dir.exists("docs")) {
dir.create("docs")
}
# Copy over the 404.html file
file.copy("404.html", "docs", overwrite = TRUE)
# Make sure all images copy to docs folder
if (!dir.exists(here::here("docs", "images"))) {
dir.create(here::here("docs", "images"))
Expand Down
6 changes: 0 additions & 6 deletions netlify.toml

This file was deleted.

0 comments on commit 6917942

Please sign in to comment.