301 redirects

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • duncan drennan
    Email problem

    • Jun 2006
    • 2642

    #1

    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, 05:52 PM. Reason: update

    |
  • sandman
    New Member
    • Jul 2008
    • 1

    #2
    301

    You might find this helpful



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

    Comment

    • Dave A
      Site Caretaker

      • May 2006
      • 22820

      #3
      Question - why redirect page for page to a new domain when you've still got the old domain?
      Participation is voluntary.

      Alcocks Electrical Services | Alcocks Pest Control & Entomological Services | Alcocks Hygiene Services

      Comment

      • Chatmaster
        Platinum Member

        • Aug 2006
        • 1065

        #4
        Originally posted by Dave A
        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.
        Roelof Vermeulen (Entrepreneurship in large organizations)
        Enterprise Art Management Software| Rock flaps south africa

        Comment

        Working...