mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat: add redirect for non-hash URLs to support HashRouter
This commit is contained in:
@@ -10,6 +10,12 @@
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
<title>5chan</title>
|
||||
<script>
|
||||
// Redirect non-hash URLs to hash URLs on initial load
|
||||
if (window.location.pathname && window.location.pathname !== '/' && window.location.pathname !== '/index.html' && !window.location.hash) {
|
||||
window.location.replace('/#' + window.location.pathname + window.location.search);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
|
||||
Reference in New Issue
Block a user