Meta Redirects using the meta refresh tag

Simply enter the following code into your websites HTML code between the <head> and </head> tags, which will redirect after 10 seconds. You can adjust the time before redirect, or simply use '0' to redirect straight away.

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

The above method is not recommended

  • Please instead use a 301 redirect wherever possible, as the above method has been used extensively by spammers, 301 redirects are greatly preferred by search engines, and some web browsers don't handle this redirect tag properly.

 

Other methods of Page Redirection

 

PHP page redirect

<?
Header( "HTTP/1.1 301 Moved Permanently" ); 
Header( "Location: http://www.newpage.com" ); 
?> 


ASP page redirect

<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.newpage.com/"
%> 


ASP .NET page redirect

<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.newpage.com");
}
</script> 


JSP Javascript Page Redirect

<%
response.setStatus(301);
response.setHeader( "Location", "http://www.newpage.com/" );
response.setHeader( "Connection", "close" );
%> 


CGI PERL Redirect

$q = new CGI;
print $q->redirect("http://www.newpage.com/"); 


Ruby on Rails Page Redirect

def old_action
headers["Status"] = "301 Moved Permanently"
redirect_to "http://www.newpage.com/"
end 


ColdFusion Page Redirect

<.cfheader statuscode="301" statustext="Moved permanently">
<.cfheader name="Location" value="http://www.newpage.com">