Redirect from Static HTML Page

Three options as a workaround if a server doesn’t allow for an htaccess file.

Javascript:

<script language="javascript">
    window.location.href = "http://example.com"
</script>

Meta Tag fallback if Javascript is disabled:

<meta http-equiv="refresh" content="0;url=http://example.com">

PHP option:

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://example.com/newpage.html");
exit();
?>

Sourced here and here.

Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.