如何将 Google 搜索结果重定向到动态网页?

发布于 2024-07-22 01:22:26 字数 805 浏览 7 评论 0原文

我正在尝试通过 XML Feed 将项目列表输入 Google Base这样,当用户搜索其中一项,然后单击 Google Base(或普通 Google)中的搜索结果链接时,用户就会被定向到我网站上的动态网页。 我假设指定特定链接(静态或动态)的唯一方法是通过 XML 提要中的属性。 那是对的吗? 因此,例如,如果我的属性是:

http://www.example.com/product1-info.html

用户将被定向到 product1-info.html 页面。

但是,如果我希望将用户重定向到动态页面,而不是静态产品页面,该页面从我的本地数据库(在我的网站上)生成包含关键字“product1”的所有产品的搜索结果,我是否能够做这样的事情?:

http://www.example.com/products.php?productID=product1

最后,也是最重要的是,有什么方法可以从“常规”Google 搜索中指定此着陆页(或任何特定着陆页)? 或者只能通过 Google Base 和属性实现? 换句话说,如果我将一堆东西放入 Google Base,如果其中任何内容出现在常规 Google 搜索中,是否有办法让我控制哪些参数传递到着陆页(从而控制哪些搜索)在登陆页面上执行),或者这是我无法控制的? 我希望我正确地解释了这一点。 预先感谢您的任何帮助。

I'm trying to enter a list of items into Google Base via an XML feed so that, when a user searches for one of these items and then clicks the search result link in Google Base (or plain Google), the user is directed to a dynamic Web page on my Web site. I'm assuming that the only way to specify a specific link (either static or dynamic) is through the attribute in the XML feed. Is that correct? So, for example, if my attribute is:

http://www.example.com/product1-info.html

the user will be directed to the product1-info.html page.

But if, instead of a static product page, I want to have the user redirected to a dynamic page that generates search results from my local database (on my Web site) for all products containing the keyword "product1", would I be able to do something like this?:

http://www.example.com/products.php?productID=product1

Finally, and most importantly, is there any way to specify this landing page (or any specific landing page) from a "regular" Google search? Or is it only possible via Google Base and the attribute? In other words, if I put a bunch of stuff into Google Base, if any of it shows up in a regular Google search, is there a way for me to control what parameters get passed to the landing page (and thus, what search is performed on the landing page), or is that out of my control? I hope I explained this correctly. Thanks in advance for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ペ泪落弦音 2024-07-29 01:22:26

第一个问题:是的,允许包含 query_string 部分的网址。
http://base.google.com/support/ bin/answer.py?hl=en&answer=78170 说:

XML example:
<link>http://www.example.com/asp/sp.asp?cat=12&id=1030</link>;

--
让我重新表述第二个问题,看看是否我理解正确(可能完全在错误的轨道上):例如 products.php?productID=product1 对产品“FooEx”执行数据库搜索,并且products.php?productID=product2 表示“BarPlus”。 现在,如果有人搜索“FooEx”并且谷歌认为您的网站相关,您希望谷歌显示链接 .../products.php?productID=product1 但不显示 ....?productId=product2 ? 这就是我们在搜索引擎中都面临的相同“问题”:传达每个 url 的相关内容。 即,例如,在页面的 title/h1 元素中出现适当的(并且仅适当的)关键字,避免链接到具有不同 url 的相同内容(例如,product.php?x=1&productId=1 <-> Product.php?productId=1&x1,不同的网址请求很可能完全相同的内容),提交站点地图,依此类推......

编辑:
您可以使用 mod_rewrite (例如 zend 框架的 前端控制器 利用它)或通过解析 $_SERVER["PATH_INFO"] 的内容(这需要网络服务器 提供该信息),例如 http://localhoast/test.php/foo/bar -> $_SERVER['PATH_INFO']=='/foo/bar'
另请查看此线程的链接:如何将 Google 搜索结果重定向到动态网页?,它包含线程的标题,但 SO 对 如何将 Google 搜索结果重定向到动态网页?。 标题“只是”搜索引擎和(甚至更多)用户的附加数据。
您也可以这样做:
http://www.example.com/products.php/product1/FooEx <-> http://www.example.com/products.php/product2/BarPlus

first question: Yes, urls containing a query_string part are allowed.
http://base.google.com/support/bin/answer.py?hl=en&answer=78170 says:

XML example:
<link>http://www.example.com/asp/sp.asp?cat=12&id=1030</link>;

--
Let me rephrase the second question to see if I understand it correctly (might be completely on the wrong track): E.g. products.php?productID=product1 performs a db-search for the product "FooEx" and products.php?productID=product2 for "BarPlus". Now you want google to show the link .../products.php?productID=product1 but not ....?productId=product2 if someone searched for "FooEx" and google decided that your site is relevant? Then it's the same "problem" we all face with search engines: communicate what each url is relevant for. I.e. e.g. have the appropriate (and only the appropriate) keywords appear in the title/h1 element of the page, avoid linking to the same contents with different urls (e.g. product.php?x=1&productId=1 <-> product.php?productId=1&x1, different urls requesting most probably the exact same contents), submit a sitemap, and so on and on....

edit:
and you can avoid the query-string part all together by using something like mod_rewrite (e.g. the front controller for the zend framework makes use of it) or by parsing the contents of $_SERVER["PATH_INFO"] (this requires the webserver to provide that information), e.g. http://localhoast/test.php/foo/bar -> $_SERVER['PATH_INFO']=='/foo/bar'
Also take a look at the link to this thread: How to redirect a Google search result to a dynamic Web page?, it contains the title of the thread, but SO is perfectly happy with How to redirect a Google search result to a dynamic Web page?, too. The title is "only" additional data for search engines and (even more) the user.
You can do the same:
http://www.example.com/products.php/product1/FooEx <-> http://www.example.com/products.php/product2/BarPlus

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文