How to do a 301 Redirect

Written on June 19, 2006 – 10:06 am | by Chris Alexander |

301 permanent Redirect

Redirects are essential for some websites. Without them pages don’t get indexed and that hurts your search engine visibility. The best way to do a redirect is to use a permanent 301 redirect. A permanent 301 redirect sends a status code to the browser alerting that the page has moved and a new page is taking its place-redirecting it permanently.

Here are a few ways you can achieve a 301 redirect:

Redirect from a subdomain to a domain

It is important for SEO that all of your backlinks go to the same URL.
Remember, www.bigoakinc.com, bigoakinc.com, www.bigoakinc.com/index.html and bigoakinc.com/index.html are all different pages to the search engines. We want all the PageRank funneling to one page.

This can be helped with a 301 redirect to send browsers and bots who go to one of your home page variations. Modifying your .htaccess file that sends a 301 redirect status is where to start.

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent,L]

If your host doesn’t allow mod_rewrite, you can use this code in an .htaccess file

Redirect 301 http://domain.com/oldpage.html

http://www.domain.com/newpage.html\

Code for various 301 redirects:

PHP Redirect
< ?
header(‘HTTP/1.1 301 Moved Permanently’);
header(‘Location: http://www.newdomain.com/newdir/newpage.htm’);
exit();
?>

ASP Redirect

<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”, “http://www.newsite.com/newdir/newpage.asp”
%>

ASP.NET Redirect
.NET ASP 301 code

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

Please use the information responsibly and be sure this will be a 301 permanent redirect. Moving it again can upset the search engines.

Chris Alexander previously worked at various technology consulting firms. In late 2003 he decided to strike out with Shell and formed Big Oak. Their partnership has allowed them to work in collaboration while having the freedom to concentrate on their core interests in the field of online marketing.

Twitter Google+ 

  1. 2 Trackback(s)

  2. Apr 30, 2008: Duplicate Content
  3. May 29, 2008: When to Use a 301 vs. 302 Redirect - SEO Tip Week 35 | Big Oak SEO Blog

Sorry, comments for this entry are closed at this time.

Big Oak SEO Blog

This SEO blog is provided by Big Oak SEO, a SEO Company. Most blog posts are related to search engine optimization, short reviews, SEO tips and increasing site conversions. Email us at contact@bigoakinc.com or give us a call 804-741-6776 to see how we can help your company. More

Want to know what Shell is doing?
Follow Shell with Twitter, just don't expect too much.

Want to subscribe?

 Subscribe in a reader Or, subscribe via email:    
Enter your email address:  
Find entries :