========================================================= -->

How to Implement 301 Redirect?

How to Implement 301 Redirect_
Spread the love

How to Implement 301 Redirect?

301 redirect is the most common need for basic search engine optimization nowadays. The most efficient way of redirecting a web page is 301 redirect. It’s not that hard to implement 301 redirects. Let’s learn about how to implement 301 Redirect? It’s the safest option to maintain your rankings on Search Engines if you moved/renames your website pages OR domain name. “301 Redirect” is interpreted as “Moved Permanently”.

As I said, 301 redirect is not a hard job to implement. You can do it easily but yes, it’s important to know which technology your website is developed. There are several technologies OR we can say programming languages available in the market like ASP, PHP, Coldfusion, HTML etc… So you should know that first.

Now, what to do after that? Nothing!!!! Really?? Yeah!

Lol. You must be surprised but I mean what I said.

Let me make it very simple for you to learn how to implement 301 Redirect?. Below I’m giving a collection of all the 301 redirection setup codes for all the technologies/programming languages. So just pick the code from below based on your website technology and implement it on your website and you’re done.

PHP Redirect

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

Redirect Old domain to New domain (htaccess redirect)

Create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain. The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

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

Please REPLACE www.newdomain.com in the above code with your actual domain name.

In addition to the redirect, I would suggest that you contact every backlinking site to modify their backlink to point to your new website.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite module enabled.

IIS Redirect

  • In internet services manager, right click on the file or folder you wish to redirect
  • Select the radio titled “a redirection to a URL”.
  • Enter the redirection page
  • Check “The exact URL entered above” and the “A permanent redirection for this resource”
  • Click on ‘Apply’

ColdFusion Redirect

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

ASP Redirect

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

ASP .NET Redirect


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

JSP (Java) Redirect

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

CGI PERL Redirect

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

Ruby on Rails Redirect

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

Summary
How to Implement 301 Redirect?
Article Name
How to Implement 301 Redirect?
Description
The most efficient way of redirecting a web page is 301 redirect. It’s not that hard to implement 301 redirects. Let's learn about how to implement 301 Redirect?
Author
Publisher Name
Egochi
Publisher Logo

Spread the love

Posted on April 20, 2018 in Search Engine Optimization

Share the Story

About the Author

Innovation & Creativity is the key to success. Hi, my name is Jobin John, before founding Egochi I worked with Brands like Xbox, American Express, SBC Yahoo. Thumb rule of business is to use hard work with intelligence.

Responses (2)

  1. Margarit Alillico
    May 6, 2018 at 12:19 pm · Reply

    It’s difficult to find knowledgeable people for this
    topic, but you seem like you know what you’re
    talking about! Thanks

  2. Kevin Neil
    April 27, 2018 at 3:22 pm · Reply

    301 redirects for SEO are really important and I think you covered everything there is to it.

Leave a reply

Your email address will not be published. Required fields are marked *

Back to Top
Top