301 redirection and 301 redirection are the same meanings.
What is 301 redirection?
How to perform 301 redirect
Redirection implementation in various environmentsCode
IIS redirection
ColdFusion redirection
<. Cfheader statuscode = "301" statustext = "moved permanently">
<. Cfheader name = "location" value = "http://www.new-url.com">
PHP redirection
<?
Header ("HTTP/1.1 301 moved permanently ");
Header ("Location: http://www.new-url.com ");
?>
ASP redirection
<% @ Language = VBScript %>
<%
Response. Status = "301 moved permanently"
Response. addheader "location", "http://www.new-url.com /"
%>
ASP. NET redirection
<SCRIPT runat = "server">
Private void page_load (Object sender, system. eventargs E)
{
Response. Status = "301 moved permanently ";
Response. addheader ("location", "http://www.new-url.com ");
}
</SCRIPT>
JSP (Java) redirection
<%
Response. setstatus (301 );
Response. setheader ("location", "http://www.new-url.com /");
Response. setheader ("connection", "close ");
%>
Cgi Perl redirection
$ Q = new CGI;
Print $ q-> redirect ("http://www.new-url.com /");
Ruby on Rails redirection
Def old_action
Headers ["status"] = "301 moved permanently"
Redirect_to "http://www.new-url.com /"
End
Old domain redirection to new domain (htaccess redirection)
Use the following code to create a. htaccess file. This will ensure that all directories and webpages in your old domain will be correctly redirected to the new domain name..The htaccess file must be placed in the root directory of your old website.
Options + followsymlinks
Rewriteengine on
Rewriterule (. *) http://www.newdomain.com/#1 [R = 301, l]
Replace www.newdomain.com with your actual domain name.
In addition to redirection, we recommend that you notify the partner to modify the link and re-link it to your new website.
Note: This method is valid only when Apache is used on the Linux server and Apache Mod-rewrite is enabled.
Redirect to www (htaccess redirect)
Use the following code to create a. htaccess file. This ensures that all requests are redirected from domain.com to www.domain.com again.
Options + followsymlinks
Rewriteengine on
Rewritecond % {http_host} ^ domain.com [Nc]
Rewriterule ^ (. *) $ http://www.domain.com/#1 [R = 301, NC]
Replace www.newdomain.com with your actual domain name.
Note: This method is valid only when Apache is used on the Linux server and Apache Mod-rewrite is enabled.
Redirection detection tool
Http://www.webconfs.com/redirect-check.php