-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathno_ssl.html
38 lines (37 loc) · 1.46 KB
/
no_ssl.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Redirecting...</title>
<style>body {font-family: Arial, sans-serif}</style>
</head>
<body>
<h2>Redirecting to a non-secure page...</h2>
<p>If you are not redirected automatically, <a id="redirect-link" href="#">click here</a>.</p>
<script type="text/javascript">
function getQueryParam() {
let urlParams = new URLSearchParams(window.location.search);
// Check if the 'url' parameter exists
if (urlParams.has('url')) {
return urlParams.get('url');
}
// If not, assume the first parameter is the target URL
else {
return window.location.search.substring(1);
}
}
let redirectTo = getQueryParam();
if (redirectTo) {
document.getElementById('redirect-link').href = redirectTo;
setTimeout(function() {
window.location.href = redirectTo;
}, 1000);
} else {
document.querySelector('h2').textContent = 'No redirect URL provided.';
document.querySelector('p').textContent = 'To use this redirect simply add your http url as a parameter to this page\'s url -- like ' + location.href + '?http://example.com'
}
</script>
</body>
</html>