【发布时间】:2015-10-13 11:38:37
【问题描述】:
我们遇到了一个问题,即 Google 认为 /product.html 与 /category/product.html 相同。它们都是相同的内容,但是是两个不同的页面。我可以手动
Redirect 301 /product1.html https://www.website.com/category/product1.html
Redirect 301 /product2.html https://www.website.com/category/product2.html
但我们有数千种产品,并且会不断添加新产品。
我想知道是否有办法做这样的事情:
Disallow: /*.html$
Allow: /*/*.html$
在 robots.txt 文件中?或者,如果有办法在 .htaccess 文件中使用 301 重定向来做到这一点。或者,如果 Opencart 中有一种方法可以自动将 /product.html 301 转换为 /category/product.html(问题在于每个产品都属于多个类别)。
谢谢
【问题讨论】:
标签: .htaccess redirect http-status-code-301 robots.txt