views:

274

answers:

4

I am creating a classifieds website called 'mySite', and I want whoever searches for honda +mySite in google, to find all ads with the description 'honda' or headline 'honda' from my database.

How is this done? (a htm page for every ad? which then loads the 'ad data' when user clicks to open the htm page?)

I have an example for you to look at: www.blocket.se is a swedish site where you can buy almost anything. I am guessing they dont actually have 500thousand html pages just so that google can find them right?

Try searching this in google: blocket +bmw 330ci and you will see results from blocket.se database.

Question is: How have they done it? and how should I do it so that I have the same functionality?

Thanks

If you need more input tell me and I will update!

+1  A: 

You need to have links to the (dynamically created) pages. Google doesn't know (or care) if the page is dynamically generated. But it's not going to find it if you don't have a link to it. The google bot doesn't just spam your search box looking for keywords (for obvious reasons).

For example, your homepage should link to a "latest" page, with a list of all your latest items. You should also create an archive page for every day with links to the items that were posted that day. These index pages can be dynamically generated, as long as there is a link to them from your home page.

Also, remember to cache your daily archives, and give a long value for the EXPIRES meta-tag, so you don't have to hit your database every time somebody has a look.

If you want to know more, google has a guide for web-masters: http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=35769

In particular, look at sitemaps: http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156184

wisty
Good answer, btw, what do you mean by "remember to cache your daily archives"
Allen
I'm suggesting that he creates a page for every day, which links to all the items posted that day. Those pages aren't going to change, so they can be cached. I should have written "cache your indexes of items posted that day".
wisty
A: 

You need to create links to your database pages. Right now the only way to get to your pages is to use the search on your site. Google doesn't fill out form fields. So create some links to your pages.

Your pages should to be search engine friendly so

  http://site.com?q=honda+civic is bad,

  http://site.com/cars/honda/civic is good.

You can rewrite urls using your framework (you are using a web application framework right?).

You need to link to these pages preferably from other sites. You won't ever get every page in google because they are too similar and google will probably throw a lot of them out. But you need links to them to start.

Byron Whitlock
Ok. I get your explanation... but could you please post an example? You are talking about auto-adding url to a 'sitemap' but what would that url lead to?
Camran
There are 2 separate issues here.1) You don't have a sitemap, so google doesn't know you have any pages.2) Even if you did, google doesn't like pages with ?q= in itSo there are 2 things to fix.
wisty
Sample code is way out of the scope of this question. we have no idea what framework you are using, if you are using one at all. Do you know how to iterate the database and generate pages?
Byron Whitlock
yes, i know that! I just dont get the idea of how to create links which are renamed to something else and then somehow add a meta-element to it? I will have to study some more I guess. But thanks
Camran
Google URL rewriting. Check stack overflow as well. You can make URLs like /cars/honda/civic automatically go to ?q=honda+civic. Good luck!
Byron Whitlock
You can modify the meta tags by editing the code the displays the page. The data for the meta tag should come from the data you are displaying.
Byron Whitlock
OK, I think I get it, you are saying crawler goes in thorugh the backdoor, even though the actual page to display the record 'honda civic' hasent yet been created, but google will find it anyway right? just as long as there is a link there to a php page which fetches data from a mysql database? right or wrong?
Camran
Url rewriting will take one (nonexistant) url and serve the data from another url (that exists). To the user/crawler it will look like the nonexistant url has the data. so even thought here is no /cars/hond/civic on your site, the web server will make the end user think there is.
Byron Whitlock
+5  A: 

You don't need an actual html page for every advertisement. Most of the time there is one page that looks at the url and displays content accordingly.

mysite.com/honda
mysite.com/acura
mysite.com/bmw

All of these urls would be handled by one page. The page would use the url to find what content to display and serve just that content.

Basically you're just creating a website and google does the rest

Galen
@camran you may be used to doing the same thing by passing a parameter to some 'index.php' such as '?type=honda'. Galen's method isn't so different if you imagine a web server responding to any requests for mysite.com with 'website.php?url=mysite.com/honda'.
deau
+3  A: 

I create a sitemap that links to every category and every dynamic page, that way spiders can easily navigate through every url on your site.

If you do this dynamically then you can easily group by popular keywords and have a special "grouped by keyword" sitemap.

At any rate, its best to have the sitemap generated dynamically so you don't miss a single dynamic page.

Allen
how about meta keywords and meta descriptions, are they also generated the same way? or how would you solve that?
Camran
meta's are certainly able to be generated dynamically, just like any other html element.
Allen
i just dont know where to start! An example would simplify things for me
Camran
break things up and do it one at a time, first step is to create a sitemap so 100% of your pages are linked to and are able to be spidered! Then you can move on to meta tags
Allen