Results 1 to 4 of 4

Thread: 301 redirects

  1. #1
    just me duncan drennan's Avatar
    Join Date
    Jun 2006
    Location
    Cape Town
    Posts
    2,642
    Thanks
    119
    Thanked 94 Times in 77 Posts

    301 redirects

    I was never really quite sure how to do a 301 redirect and was never successful when trying to use cPanel, but I have finally got it working as I would like

    Let's back up a second.....what the heck is a 301 redirect? A 301 redirect permanently redirects a certain url to another url. There are a couple of reasons this could be useful, but the reason I want to do it is to ensure that all queries to my website land up at the same URL.

    I have two domains, engineersimplicity.com and engineersimplicity.co.za. Both domains point to the same content. This can potentially be a bad thing from a SEO perspective. I always want the search engines to use a particular domain, and that is www.engineersimplicity.com.

    So, by setting up the correct 301 redirects browsers will now always land on www.engineersimplicity.com, even if they typed in engineersimplicity.com, engineersimplicity.co.za or www.engineersimplicity.co.za. This is good for me, for the website users and for the search engines.

    Here are the instructions for setting up 301 redirects. I did it using the .htaccess file which is available on all Apache web servers.

    Here is the code I added to the .htaccess file (change yourdomain to your domain )

    PHP Code:
    Options +FollowSymlinks
    RewriteEngine on
    rewritecond 
    %{http_host} ^yourdomain.com [nc]
    rewriterule ^(.*)$ http://www.yourdomain.com/$1 [r=301,nc]
    rewritecond %{http_host} ^yourdomain.co.za [nc]
    rewriterule ^(.*)$ http://www.yourdomain.com/$1 [r=301,nc]
    rewritecond %{http_host} ^www.yourdomain.co.za [nc]
    rewriterule ^(.*)$ http://www.yourdomain.com/$1 [r=301,nc] 
    [EDIT] This still isn't working quite how I would like it to. If I go to a specific page it stays on that domain, rather than going to the other domain. I'll update this when I figure it out - or does someone here have some tips? Whoops, scratch that, it does work properly.
    Last edited by duncan drennan; 24-Mar-08 at 05:52 PM. Reason: update
    [SIGPIC]Engineer Simplicity[/SIGPIC]
    Turn ideas into products | The Art of Engineering blog

  2. #2
    New Member
    Join Date
    Jul 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    301

    You might find this helpful

    http://www.pauldesousa.co.za/complet...-for-wordpress

    This dude explains how to do a 301 to a new domain while keeping the structure the same. very useful

  3. #3
    Site Caretaker Dave A's Avatar
    Join Date
    May 2006
    Location
    Durban, South Africa
    Posts
    20,980
    Thanks
    3,055
    Thanked 2,462 Times in 2,067 Posts
    Blog Entries
    12
    Question - why redirect page for page to a new domain when you've still got the old domain?
    The trouble with opportunity is it normally comes dressed up as work.

  4. #4
    Platinum Member Chatmaster's Avatar
    Join Date
    Aug 2006
    Location
    Cape Town
    Posts
    1,065
    Thanks
    107
    Thanked 97 Times in 63 Posts
    Quote Originally Posted by Dave A View Post
    Question - why redirect page for page to a new domain when you've still got the old domain?
    This happens a lot when an existing website was purchased or your business undergo a brand change. By 301 redirecting each page to the new one, the search engines are told to transfer all the relevant backlinks to those internal pages on the old site to the internal page on the new site. It is the safest way of ensuring you keep the strength and SEO work done on the old site. A 301 is also useful when the page names are renamed for example blah.htm changed to blah.asp but it is still the same page. All those old and established backlinks to the old page will now be carried over to the new page.

    From a user perspective it ensures that people that click through from the old backlink, still finds the content they were looking for, therefore no dead links.

Tags for this Thread

Did you like this article? Share it with your favourite social network.

Did you like this article? Share it with your favourite social network.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •