No credit card. Takes under a minute.

Login
INSIGHTS3 MIN READ

HTTP 301 The Redirect Basics

AngelsBird

Published on January 26, 2016

Published on Wealthy Affiliate — a platform for building real online businesses with modern training and AI.

Hello,

Often we hear to use a redirect when a webpage is not reachable anymore or a URL is changed. But I thought it might be handy for a lot of people to list the basics of such a redirect.

$

First of all: When do you use a Redirect?

  • As default – this is the preferred method for every page redirection.
    (You can also use canonical URL’s but the 301 redirect is the preferred method.)
  • For pages that are permanently moved or replaced.
  • Domains that are permanently moved (acquisitions, rebranding, etc.).
  • 404 pages and expired content (when there is still relevant content or the page still exists).


Why?

The most important search engines are cracking down on websites that use sneaky redirects or point multiple domains to the same content, without using a proper redirect. The 301 permanent redirect is therefore also known as a search engine friendly redirect.

Where?

Ready to put this into action?

Start your free journey today — no credit card required.

The best practice is to create the 301 redirect at the.htaccess file.
This file is located in the HttpDocs folder of your site, you can access this file easily thru an FTP client and edit the file as a text file.

To use the .htaccess file your website has to be on an Apache (Linux, Unix) based server. Here at WA this is the case, so for everybody with their site hosted on WA, this procedure can be applied.
If you use another hosting and you are unsure, then a simple header check will indicate your server type.

You can use this link to do this: http://tools.seobook.com/server-header-checker/

But you can also use your SEO plugin (I think the all in one has this possibility also), for Yoast you do it like this:
http://kb.yoast.com/article/305-how-to-edit-htacce...


How to setup a 301 Redirect

The basic code for redirecting is:
Redirect 301 old_location new_location

Redirect a single page:
Redirect 301 /oldpage.php http://www.yoursite.com/newpage.php
Redirect 301 /oldpage2.php http://www.yoursite.com/folder

You have moved your domain to another site / domain name:
Then you actually want to redirect the whole site, replace, of course, the previoussite and newsite values with the real values.
These 4 lines have to be added in the .htaccess file:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^previousSite\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.previousSite\.com$
RewriteRule ^(.*)$ "http\:\/\/newSite\.com\/$1" [R=301,
L]

That is about it for the basics, of course, a lot more can be said about this redirection method. But when you understand the above well, then you can go already a long way with this knowledge...

I hope you liked this piece of info... ;-)

Grtz,
Bert

Share this insight

This conversation is happening inside the community.

Join free to continue it.

The Internet Changed. Now It Is Time to Build Differently.

If this article resonated, the next step is learning how to apply it. Inside Wealthy Affiliate, we break this down into practical steps you can use to build a real online business.

No credit card. Instant access.

2.9M+

Members

190+

Countries Served

20+

Years Online

50K+

Success Stories

The world's most successful affiliate marketing training platform. Join 2.9M+ entrepreneurs building their online business with expert training, tools, and support.

Member Login

© 2005-2026 Wealthy Affiliate
All rights reserved worldwide.

🔒 Trusted by Millions Worldwide

Since 2005, Wealthy Affiliate has been the go-to platform for entrepreneurs looking to build successful online businesses. With industry-leading security, 99.9% uptime, and a proven track record of success, you're in safe hands.