301 redirects

Discussion in 'Search Engine Optimization' started by letas, Aug 11, 2006.

  1. #1
    Hi,

    I need to change the script i use in my site to a diferent one (in PHP).

    The problem is that im getting good SE traffic and i don't want to loose it from about 10.000 index pages.

    So what do you think i should do?

    Change the main folder from site.com to site.com/new-site/ ?
    Delete current site and insert new one?

    To keep it simple i would like to redirect users from all older urls to my new home page.

    With a 301 redirect will visitors get redirected to my new homepage? I played around with it but didnt work lol.

    So do you think its possible? How?

    Thanks :)
     
    letas, Aug 11, 2006 IP
  2. Jean-Luc

    Jean-Luc Peon

    Messages:
    601
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yes, it is perfectly possible to redirect (301) all old pages to the new home page.

    It is not too difficult if the old URL's can be easily distinguished from the new ones.

    Jean-Luc
     
    Jean-Luc, Aug 11, 2006 IP
  3. DarrenC

    DarrenC Peon

    Messages:
    3,386
    Likes Received:
    154
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes, it is imperative that you use a 301 direct, as using javascript of 302 direct can get you in trouble with the search engines.
     
    DarrenC, Aug 11, 2006 IP
  4. andre75

    andre75 Peon

    Messages:
    1,203
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I would completely replace the old one. I have done this before without any bad effects on SE.
    I have redirected all urls to the new ones using a couple of regexp. Took a while to figure out, because regular expressions are hard to get right (for me), but worked nicely.

    Here is an example:
    RewriteRule ^(.*)\.html$ http://www.example.com/index.php?=$1 [R=301,L]

    This redirects all requests to file1.html to http://www.example.com/index.php?=file1
    (or so I think, haven't tested it).
    You can do more intelligent things like removing all "/" before creating your query string and then redirecting again to make it look like static html (most urls of my photo website look like static html but are really dynamic) - make sure you don't built loops by accident. Its always a good idea to build a local test environment with xampp.

    Another example is my html cache (builds html files from php files and recreates them ever so often, then checks if the files are there, if yes serve html instead of php, html files are stored in the static folder, the whole process is not visible to the user):
    http://www.aguntherphotography.com/projects/webcache/implementation.htm
    The modrewrites could prob. be adapted for your case.
     
    andre75, Aug 11, 2006 IP
  5. sebastya

    sebastya Well-Known Member

    Messages:
    2,449
    Likes Received:
    46
    Best Answers:
    0
    Trophy Points:
    138
    #5
    htaccess redirect = good
    javascript redirect = bad
     
    sebastya, Aug 11, 2006 IP
  6. DarrenC

    DarrenC Peon

    Messages:
    3,386
    Likes Received:
    154
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Read this article

    It gives examples of the code - none of them match what I want to do, but it might help you.
     
    DarrenC, Aug 11, 2006 IP
    letas likes this.
  7. andre75

    andre75 Peon

    Messages:
    1,203
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    0
    #7
    which translates pretty much into:
    apache hosting = good
    IIS hosting = bad
     
    andre75, Aug 11, 2006 IP
  8. john269

    john269 Notable Member

    Messages:
    6,229
    Likes Received:
    116
    Best Answers:
    0
    Trophy Points:
    235
    #8
    Yeah, I agree, using 302 redirects or meta redirects are likely to give you trouble and can even get you banned from the major search engines.

     
    john269, Aug 12, 2006 IP
  9. andre75

    andre75 Peon

    Messages:
    1,203
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    0
    #9
    No way man. 302 = temporary redirect, 301 = permanent redirect.
    The 302 has been used to steal content, but has many perfectly legitamate uses (e.g. mainanance messages). I don't think you will ever have problems for using a 302 on your own website.
     
    andre75, Aug 12, 2006 IP
  10. TETRHA

    TETRHA Peon

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    301 redirect is ok for SEO, i tried many sites, i can say PR is moving to the redirecting page w/o any loss

    <?php
    Permanent redirection header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.somacon.com/");
    exit(); ?>
     
    TETRHA, Aug 12, 2006 IP
  11. john269

    john269 Notable Member

    Messages:
    6,229
    Likes Received:
    116
    Best Answers:
    0
    Trophy Points:
    235
    #11
    I think the meta refreshes are the main ones which you have to watch and try to not use.
     
    john269, Aug 13, 2006 IP
  12. bluemouse2

    bluemouse2 Well-Known Member

    Messages:
    4,055
    Likes Received:
    130
    Best Answers:
    0
    Trophy Points:
    185
    #12
    I read some posts today and it seems that there can be a minor loss
    if you have pr4 for example you can get only pr3 and so on
     
    bluemouse2, Aug 13, 2006 IP
  13. ewc21

    ewc21 Peon

    Messages:
    455
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Apache definitely supports Javascripts so your analogy is inaccurate.
     
    ewc21, Aug 14, 2006 IP