We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b23339 commit 9473fbbCopy full SHA for 9473fbb
src/libs/redirect.js
@@ -1,4 +1,5 @@
1
import {config} from '@/client_config.js'
2
+import { remove_base } from './client_utils'
3
4
export async function redirectToFullUrl() {
5
if(document.title == "not found"){
@@ -9,7 +10,10 @@ export async function redirectToFullUrl() {
9
10
11
const response = await fetch(`${config.base}/api/redirect`)
12
const redirects = await response.json()
- let pathname = window.location.pathname.substring(1)
13
+ let pathname = remove_base(window.location.pathname)
14
+ if(pathname.startsWith("/")){
15
+ pathname = pathname.substring(1)
16
+ }
17
if (pathname in redirects) {
18
const new_url = redirects[pathname]
19
if(new_url){
0 commit comments