File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 11<!DOCTYPE html>
22< html >
33 < head >
4- < meta http-equiv ="refresh " content ="0; url=./ " />
4+ < meta charset ="utf-8 " />
5+ < title > Redirecting...</ title >
6+ < script type ="text/javascript ">
7+ // Redirect all paths (like /leaderboard) back to index.html,
8+ // but preserve the original path for React Router.
9+ const redirectTo = window . location . protocol + '//' + window . location . host + '/?' +
10+ 'p=' + window . location . pathname + window . location . search + window . location . hash ;
11+ window . location . replace ( redirectTo ) ;
12+ </ script >
513 </ head >
6- < body > </ body >
14+ < body >
15+ </ body >
716</ html >
Original file line number Diff line number Diff line change 11<!doctype html>
22< html lang ="en ">
33 < head >
4+ < script type ="text/javascript ">
5+ // If we came here via the redirect above, rewrite the URL back
6+ // to the original path so React Router can pick it up.
7+ ( function ( ) {
8+ const params = new URLSearchParams ( window . location . search ) ;
9+ const redirectPath = params . get ( 'p' ) ;
10+ if ( redirectPath ) {
11+ window . history . replaceState ( { } , '' , redirectPath ) ;
12+ }
13+ } ) ( ) ;
14+ </ script >
415 < meta charset ="utf-8 " />
516 < link rel ="icon " href ="%PUBLIC_URL%/favicon.ico " />
617 < meta name ="viewport " content ="width=device-width, initial-scale=1 " />
You can’t perform that action at this time.
0 commit comments