De Wiki ArgoHost.net
Como criar redirecionamentos de paginas
Redirecionamento 301 com PHP
<?
Header( “HTTP/1.1 301 Moved Permanently” );
Header( “Location: http://www.meusite.com.br” );
?>
Redirecionamento 301 com ASP
<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”,”http://www.meusite.com.br/”
%>
Redirecionamento 301 com ASP .NET
<script runat=”server”>
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = “301 Moved Permanently”;
Response.AddHeader(”Location”,”http://www.meusite.com.br”);
}
</script>
Redirecionamento 301 com JSP (JAVA)
<%
response.setStatus(301);
response.setHeader( “Location”, “http://www.meusite.com.br/” );
response.setHeader( “Connection”, “close” );
%>
Redirecionamento 301 com Coldfusion
<.cfheader statuscode=”301″ statustext=”Moved permanently”>
<.cfheader name=”Location” value=”http://www.meusite.com.br”>
Redirecionamento 301 com CGI(Perl)
$q = new CGI;
print $q->redirect(”http://www.meusite.com.br/”);
Redirecionamento 301 com Ruby on Rails
def old_action
headers[”Status”] = “301 Moved Permanently”
redirect_to “http://www.meusite.com.br/”
end
Redirecionamento 301 com .htaccess
redirect 301 /antigo/arquivo_antigo.htm http://www.seusite.com.br/aquivo_novo.htm