301 redirect is most common need of basic search engine optimization nowadays. The most efficient way of redirecting a web page is 301 redirect. It’s not much hard 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 on which technology your website is developed. There are several technology 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?? Yeahhh!
Lol. You must be surprised but I mean what I said.
Let me make it very simple for you. 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

Cheers, and good luck! Keep up the great posts!
Thanks for the blog topic. I just got online for the first time 2 monthsago. I am an addict, but enjoying the new found discovery. Thanks again.
This really answered my problem, thank you!
good post, I found it quite informative, and it answered most with the concerns I had.
Attractive section of content. I just stumbled upon your weblog and in accession capital to assert that I get in fact enjoyed account your blog posts. Anyway I’ll be subscribing to your augment and even I achievement you access consistently rapidly.
I think so. I think your article will give those people a good reminding. And they will express thanks to you later
from a seo in Kentucky, Thanks thats a bunch of information you have!
You really know your stuff… Keep up the good work!
Useful blog website, keep me personally through searching it, I am seriously interested to find out another recommendation of it.
I’m a blog crazed person and i love to read cool blog like yours.~;~~`
kind of a long post, ill bookmark it and read it after work
After study a few of the blog posts on your website now, and I truly like your way of blogging. I bookmarked it to my bookmark website list and will be checking back soon. Pls check out my web site as well and let me know what you think.
- Howdy , Thank you a lot for making this post . I m into gaming niche and have found this weblog using search on bing . Will be sure to read trough . I am marketer and have found your site very informational Thank you , cheers.
Wow! This could be one particular of the most helpful blogs We have ever arrive across on this subject. Actually Great. I am also an expert in this topic so I can understand your hard work.
I don’t understand SEO. How is anyone suppose to understand and actually be able to index and rank thier own site better. everyone lies nothing makes sense.
Excellent article, very related to my interest thank you so much …
Whats up, This page is extremely educational and fun to read. I am a huge follower of the things blogged about. I also love reading the comments, but it seems like a great deal of readers need to stay on topic to try and add something to the original topic. I would also encourage all of you to bookmark this page to your most used service to help get the word out. Thanks