Redirecting from one website to another

After almost 15 years working freelance, my wife is in the process of winding up her business, in preparation to start a new job in a few weeks’ time.

Unsurprisingly, that means a few IT requests for the (unpaid) IT Manager… one of which is to redirect the former company website to her LinkedIn profile.

There are a few ways to redirect websites – an HTML meta tag is often used – but with the variety of web browsers out there I wasn’t sure how current that technique is. Some would argue it’s better to sort out the re-write server-side but I don’t have that ability on this hosting platform.

Then I found a really useful thread on Stack Overflow – including this code snippet with HTML, JavaScript and fallback links:

<!DOCTYPE HTML>
<html lang="en-US">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="refresh" content="1; url=http://example.com">
        <script type="text/javascript">
            window.location.href = "http://example.com"
        </script>
        <title>Page Redirection</title>
    </head>
    <body>
        <!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
        If you are not redirected automatically, follow this <a href='http://example.com'>link to example</a>.
    </body>
</html>

That’s in place now and working nicely.

Leave a Reply