Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dvho committed Jul 27, 2024
1 parent 91c481a commit a770e8d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
17 changes: 9 additions & 8 deletions 404.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<!--
Because this site is deployed to GitHub Pages, which doesn't support client-side routing, this file is used to handle the anticipated 404 errors thrown when a user tries to access any page that's not the root. This file forces a redirect to index.html, which is the entry point of the React app, so that react-router-dom can handle the routing on the client side...
Because this site is deployed to GitHub Pages, which doesn't support client-side routing, this file is used to handle the anticipated 404 errors thrown when a user tries to access any page that's not the root. This file forces a redirect to the root path so as to allow react-router-dom to handle routing on the client side...
-->

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="refresh" content="0; url=./index.html" />
<script>
//...this script is for redirecting to the index.html page if the user tries to access a page that does not exist, thereby ensuring that react-router-dom is handling routing on the client side because GitHub Pages does not support client-side routing...
var pathname = window.location.pathname
if (pathname !== '/') {
//...if the current path is not the root, redirect to index.html so that react-router-dom can handle the routing
window.location.replace('/index.html')
}
//...this script is for redirecting to the root path if the user tries to access a page that does not exist, thereby ensuring that react-router-dom is handling routing on the client side because GitHub Pages does not support client-side routing...
var redirectTo = '/index.html'
var query = window.location.search
var hash = window.location.hash
var path = window.location.pathname
var newUrl = redirectTo + query + hash
console.log('Redirecting to: ' + newUrl)
window.location.replace(newUrl)
</script>
</head>
<body>
Expand Down
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

0 comments on commit a770e8d

Please sign in to comment.