Skip to content

Instantly share code, notes, and snippets.

@joemaller
Last active March 8, 2019 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joemaller/5dcef8e2b58444dcb9d6ea7300b2cff9 to your computer and use it in GitHub Desktop.
Save joemaller/5dcef8e2b58444dcb9d6ea7300b2cff9 to your computer and use it in GitHub Desktop.
A basic redirect page with fallbacks: Meta refresh tag, JavaScript window.location and a bare link
<!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">
<meta http-equiv="refresh" content="0;url=SITE_ADDRESS" />
<title>SITE_NAME Redirect</title>
<style>
html,
body {
height: 100%;
}
body {
margin: 0;
font-family: sans-serif;
font-size: 1.5em;
}
.wrap {
display: flex;
align-items: center;
justify-content: center;
height: 60%;
}
a {
padding: 1em 2em;
color: #46c;
}
</style>
<script>
window.location = "SITE_ADDRESS";
</script>
</head>
<body>
<div class="wrap">
<a href="SITE_ADDRESS" class="link">Go to SITE_NAME</a>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment