如何让搜索引擎索引数据库驱动的内容? [英] How to Have Search Engines Index Database-Driven Content?

查看:103
本文介绍了如何让搜索引擎索引数据库驱动的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使数据库中的内容可用于搜索引擎(如google)进行索引?

How can I make it so that content from a database is available to search engines, like google, for indexing?

示例:

mysql中的表有一个名为Headline的字段,等于'BMW M3 2005'。
我的网站名称是MySite

Table in mysql has a field named 'Headline' which equals 'BMW M3 2005'. My site name is 'MySite'

用户在google中输入BMW M3 2005 MySite,记录会显示结果?

User enters 'BMW M3 2005 MySite' in google and the record will show up with results?

推荐答案

Google会索引网页,因此您需要为每个记录设置一个网页,这并不表示您需要创建1,000个HTML页面,但按照我的建议上面的动态/容易为每个产品提供一个看似独特的页面。

Google indexes web pages, so you will need to have a page for each of your records, this doesn't mean to say you need to create 1,000 HTML pages, but following my advice above will dynamically / easily provide a seemingly unique page for each product.

例如:

www.mydomain.com/buy/123/nice-bmw-m3-2005

您可以使用.htaccess将此链接更改为:

You can use .htaccess to change this link to:

www.mydomain.com/product.php?id=123



在此脚本中,您可以动态创建每个页面,

Within this script you can dynamically create each page with up-to-date information by querying your database based on the product id in this case 123.

您的脚本将为每个记录提供自己的标题('Nice BMW M3 2005') ,一个很好的友好URL('www.mydomain.com/buy/123/nice-bmw-m3-2006'),你可以包括正确的元信息,以及图像,评论等等。

Your script will provide each record with it's own title ('Nice BMW M3 2005'), a nice friendly URL ('www.mydomain.com/buy/123/nice-bmw-m3-2006') and you can include the correct meta information too, as well as images, reviews etc etc.

作业完成,您不必创建数百个静态HTML页面。

Job done, and you don't have to create hundreds of static HTML pages.

有关.htaccess的详细信息,请检查请本教程

For more information on .htaccess, check out this tutorial.

这篇关于如何让搜索引擎索引数据库驱动的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆