What type of redirect should I use?

Discussion in 'Search Engine Optimization' started by adacprogramming, Apr 11, 2006.

  1. #1
    The question will be based on www.norcalcars.com. But I think it will apply to any site that keeps an inventory.

    I have set up the site so that the search engines find a description on each individual car. Once the car is sold I remove the car from my inventory and the car details page http://www.norcalcars.com/vehicle_details.asp?id=4848&from=showroom&stype=Dealers will no longer exist. From the URL you can see this is an asp page filled by a database entry.

    The problem is now that this car and it's page is gone when the search engines show this page in the serp and someone clicks on it they see an error.

    I seem to have three choices.
    1) redirect in the code, not using a 301. I don't think Google like this much.
    2)Use a 301 redirect on this URL going back to the search page. Will Google only redirect this URL with this variable or will it try to redirect the whole page, (all calls to this page now will be redirected). ie vehicle_details.asp? How will this affect any page rank the page might have.
    3)Leave the page available forever and put on the old page "this car is no longer available" I think this is what EBay does. However this posses the possibility that eventually I will have more old pages spidered by Google than fresh inventory.

    All three are valid from a programming perspective, but which would be best from a SEO perspective?
     
    adacprogramming, Apr 11, 2006 IP
  2. themole

    themole Peon

    Messages:
    82
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It would be best to 301 redirect it to a similiar product, or display a not found/item sold page (be helpful and suggest some alternatives though. you don't want the visitor to turn around and leave right away)

    I had similiar problem once. I just did a check if the page existed right at the start of the code, if not 301 redirect to my homepage or whatever was supposed to replace it. Just see if the id exists or not right at the beginning of your code and if not redirect. If I knew .net I would show you an example in that but I don't. I'll have to use php.

    
    //Just really basic code to give you an idea of what I'm talking about. 
    
    $query = "select id from cars where id = '$id'";
    $result = mysql_query($query);
    
    if(mysql_num_rows($result) == 0 ) //If no rows are found with that id, we want to redirect here
    {
    	header ('HTTP/1.1 301 Moved Permanently');
    	header ('Location: http://http://www.norcalcars.com/');
    }
    
    
    Code (markup):
    -the mole
     
    themole, Apr 11, 2006 IP
  3. guru-seo

    guru-seo Peon

    Messages:
    2,509
    Likes Received:
    152
    Best Answers:
    0
    Trophy Points:
    0
    #3
    301 with .htaccess is the way to go for sure.
     
    guru-seo, Apr 11, 2006 IP
  4. adacprogramming

    adacprogramming Well-Known Member

    Messages:
    1,615
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    125
    #4
    Thanks Guro-SEO, I'm using a windows server, so that isn't available. I also need something more dynamic.

    Thanks for the input Mole. That is what I planed to do if I chose option 2. Sounds like you've done this without any adverse results. I can write the code, I'm more concerned with keeping the search engines happy.
     
    adacprogramming, Apr 12, 2006 IP
  5. themole

    themole Peon

    Messages:
    82
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #5
    It helps a ton. 301 redirects are great to get out of the google sandbox.

    -the mole
     
    themole, Apr 12, 2006 IP
  6. neosite

    neosite Peon

    Messages:
    23
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    In an effort to cover all bases, create a custom 404 page that the visitor can use to get back into your site.

    Perhaps a list of links and a search site box.

    But, also, 301 is the way to go.
     
    neosite, Apr 12, 2006 IP
  7. Cristian Mezei

    Cristian Mezei Notable Member

    Messages:
    3,332
    Likes Received:
    355
    Best Answers:
    0
    Trophy Points:
    213
    #7
    Man ... You don't need this hush-hush.

    Just listen to me : Do a "This classified ad is no longer available. Click here to go back to the Nissan (or mercedes, or ferrari) cars category, and search another car", with the car brand put automatically, viewing the classfied that the user wanted to see (by the URL).

    Ok ? :)

    Always try to avoid redirect (especially a lot of them), 301 or not.
     
    Cristian Mezei, Apr 12, 2006 IP