How to do a 301 Redirect

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,,, and 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} ^
RewriteRule ^(.*)$$1 [R=permanent,L]

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

Redirect 301

Code for various 301 redirects:

PHP Redirect
< ?
header(‘HTTP/1.1 301 Moved Permanently’);

ASP Redirect

<%@ Language=VBScript %>
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”, “”

ASP.NET Redirect
.NET ASP 301 code

ColdFusion Redirect
< .cfheader statuscode=”301″ statustext=”Moved permanently”>
< .cfheader name=”Location” value=””>

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