-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
43 lines (39 loc) · 1.71 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
window.onload = function() {
// Function to extract query parameters from a URL
function getQueryParams(url) {
var queryParams = {};
var params = url.substring(url.indexOf('?') + 1).split('&');
for (var i = 0; i < params.length; i++) {
var pair = params[i].split('=');
queryParams[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
}
return queryParams;
}
// Capture the original requested URL (including path and query parameters)
var originalUrl = window.location.href;
// Define the old base URL and the new base URL
var oldBase = "https://hmnn-lab.github.io";
var newBase = "https://hmnn-lab.com";
// Check if the current URL starts with the old base URL
if (originalUrl.startsWith(oldBase)) {
// Extract path and query parameters
var pathAndQuery = originalUrl.substring(oldBase.length);
// Redirect to the new URL with the same path and query parameters
var newUrl = newBase + pathAndQuery;
window.location.href = newUrl;
} else {
// If the current URL does not start with the old base URL, redirect to the new base URL
window.location.href = newBase;
}
}
</script>
<title>Page Redirection</title>
</head>
<body>
If you are not redirected automatically, follow this <a id="redirect-link" href="https://hmnn-lab.com/">link</a>.
</body>
</html>