0

我正在 Zend 框架中构建一个网站,并且我正在使用一个布局页面,该页面应用于我的所有页面。它的一般结构如下:

<!DOCTYPE>
<html>
<head>
</head>
<body>
Content of individual pages comes in here...
</body>
</html>

理想情况下,我想在这个 zend 布局页面中放置<title><meta name="description">,然后根据内容来自哪个页面动态地从我的数据库中提取这些标签的内容。不幸的是,虽然谷歌很高兴给我关于如何编写标题/描述/等标签的大量信息,但我无法确认从数据库中提取它们是否可以。是吗?我想错了吗?我担心爬虫将无法获取此内容。有没有更好的方法将标题、描述等与页面相关联(除了在包含此信息的每个单独页面中编写头部部分)?

谢谢您的帮助!(我怀疑这是一个简单的问题,但我想在某处确认答案!)

4

2 回答 2

1

是的,可以将标题和元描述存储在数据库中。

It is not generally possible for a web browser or a web crawler to even tell whether information is stored on the server in a database, or whether it comes from static files. Google won't even know for sure that your titles and meta descriptions are stored in a database.

Pretty much every CMS system such as WordPress and Drupal store all the content (including titles and meta descriptions) in a database. It is very common practice.

于 2013-04-28T10:04:10.527 回答
1

The direct answer to your question is yes, you can store metadata in database.

Storing metadata in database doesn't affect whether Google crawlers will or will not crawl your pages successfully. As long as you write <title> and <meta> elements correctly with the info from the database on your pages you'll have no problems.

于 2013-04-28T10:04:19.333 回答