301 Redirect

Redirectionare domeniu

Redirectionare site

Htacces Redirect

Cum fac redirectionare 301/Cum redirectionez 301

Redirect 301 in PHP

<?
Header( “HTTP/1.1 301 Moved Permanently” );
Header( “Location: http://www.raducu.info” );
?>


Redirect in ColdFusion

<.cfheader statuscode=”301″ statustext=”Moved permanently”>
<.cfheader name=”Location” value=”
http://www.raducu.info/“>


Redirect in IIS

In managerul servicii internet,click dreapta pe fisierul sau folderul pe care doresti sa il redirectionezi.

Selectati radio intitulat”Redirectionare sper un URL”

Introduceti pagina de redirectionare

Verificati Url-ul de redirectionare

Click Apply


Redirect in ASP

<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”,”
http://www.raducu.info/
%>


Redirect in ASP .NET

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


Redirect in JSP(JAVA)/Redirect in Java Script

<%
response.setStatus(301);
response.setHeader( “Location”, “
http://www.raducu.info/” );
response.setHeader( “Connection”, “close” );
%>


Redirect in CGI Perl

$q = new CGI;
print $q->redirect(“
http://www.raducu.info/”);


Redirect in Ruby on Rails

def old_action
headers[“Status”] = “301 Moved Permanently”
redirect_to “
http://www.raducu.info/
end


Redirectionare domeniu vechi catre domeniul nou

Creati un fisier .htaccess care sa contina codul de mai jos

Fisierul .htaccess trebuie plasat in directorul radacina al vechiului domeniu,in acelasi director un se afla si index.php

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.raducu.info/$1 [R=301,L]

Nota:Aceasta metoda functioneaza doar pe serverele cu Linux ce are modulul Apache Mod-Rewrite activat.

Redirectionare spre WWW

Creati un fisier .htaccess care sa contina codul de mai jos

Fisierul .htaccess trebuie plasat in directorul radacina al vechiului domeniu,in acelasi director un se afla si index.php

Options +FollowSymlinks
RewriteEngine on

rewritecond %{http_host} ^domain.com [nc]

rewriterule ^(.*)$ http://www.raducu.info/$1 [r=301,nc]