301 redirect.

mammu

New Member
I just changed the domain of my site.

After i setup the board on new domain, i just added this code in .htaaccess file of new board.

Code:
#  Enables or disables runtime rewriting engine 
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
#  Site has permanently moved to new domain
#  old_domain.com to new_domain.com
RewriteCond   %{HTTP_HOST}   ^www.old_domain.com$   [NC]
RewriteRule   ^(.*)$   http://www.new_domain.com/$1   [R=301,L]
I am not sure if i am sucessfully done with the job of 301 redirect.
Or is there anything else i am supposed to do.
How do i know if it is working successfully for the board?
 

veenuisthebest

New Member
Use the codes below:-
Works perfectly to redirect my board to a new location and you'll not loose your search engine rankings too...

Note:- You do not have to put these codes in .htaccess instead create a separate asp/asp.net/php file as required and set it as your default document for the domain. Its that easy !!

ASP Redirect:-

Code:
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.your-new-url.com/"
%>

ASP.NET Redirect

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

PHP Redirect

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

xXEsEtUlOnXx

New Member
PHP:
Header(”HTTP/1.1 301 Moved Permanently”);
$redireccion = “http://www.newsiteforexample.com”.$_SERVER[”REQUEST_URI”];
Header(”Location: $redireccion”);
 

xXEsEtUlOnXx

New Member
Sorry, this es the best option (i use it for redirect warez-master.uni.cc to warezmaster.net):
in the old domain upload this htaccess:

Code:
redirectMatch 301 ^(.*)$ http://www.warezmaster.net$1


replace ..:::Warez-Master:::.. La mejor comunidad de descargas, El mejor software Gratis! with you url.

With it, if somebody enter in yourolddomain.com/asd/cars.html this htaccess automaticaly redirect to yournewdomain.com/asd/cars.html (too redirect the robots and google xD and you don't loose your pagerank.

Sorry for my english, but i speak and talk spanish...
 
Top