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?
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
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.
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.
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.