gpt4 book ai didi

php - codeigniter 中的两种类型的 URL。一种用于分页,另一种用于显示项目 - 怎么做?

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:31:40 26 4
gpt4 key购买 nike

我有一些 codeigniter gallery 应用程序和我自己的搜索引擎等。

在单个项目页面上,有下一个上一个 按钮用于在图像之间导航。

我的图片网址如下:

myurl.com/image/keyword/res_position

keyword 变量显然是用户输入的搜索关键字,res_position 是结果列表中的位置 - 我需要它在下一个和上一个之间导航。

Ofc 我的下一个项目有 url

myurl.com/keyword/res_position+1 

和之前的

myurl.com/keyword/res_position-1  

就是这样。就像一个魅力。

我的问题是我想要一些只能用于显示单个图像的方法。我想过

mysite.com/image/id 

这将完成工作 - 但我担心重复的内容和 SEO 方面。

如您所见,我的“下一个-上一个”URL 结构有很多变体,因为用户可以键入很多其他关键字,而且单个图像的“res-position”每次都可以是不同的数字。

你能给我推荐一些解决这个问题的方法吗?

最佳答案

只是一个想法-

为同一内容提供多个 URI 会导致重复问题,但我认为您对此无能为力。但是,您可以尝试使用 robots.txt 禁止搜索引擎访问某些 URL - 这应该可以帮助您解决重复内容问题...

User-agent: *
Disallow: /image/something

更新

Robots.txt is also used to avoid what is known as “canonicalization” problems or having multiple “canonical” URLs. This problem is sometimes referred to incorrectly as a “duplicate content” problem.

Canonicalization problems occur where multiple pages on a website contain the same information. For example, a product page might also have a “Print” version to make it easier to print out the specs and details on the product. This can pose a problem to search engines who then have to figure out which version of the page (i.e. site.com/product-a.html or site.com/product-a-print.html) is the canonical one. Robots.txt would be used to keep the secondary version(s) from being indexed.

引用:http://seoroi.com/seo-faq/robotstxt-what-it-is-why-its-used-and-how-to-write-it/

关于php - codeigniter 中的两种类型的 URL。一种用于分页,另一种用于显示项目 - 怎么做?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11859639/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com