【发布时间】:2014-09-28 12:51:16
【问题描述】:
我正试图找出 Moz 的爬虫卡住的问题的根源。我们需要解决的一个简单问题是我们有同一页面的重复项,即:
/capabilities/
/capabilities/index.html
少数几个目录会出现该问题。但是我们也有一个问题,似乎是在为这个子目录创建一个可以访问的无限循环页面:
/customer_service.html/
/customer_service.html/contact/index.html
/customer_service.html/contact_us/contact_form.php
/customer_service.html/contact/contact/contact/contact/index.html
/customer_service.html/contact/contact/contact_us/contact_form.php
/customer_service.html/contact_us/contact/contact/contact/index.html
/customer_service.html/contact_us/contact/contact/contact_us/contact_form.php
/customer_service.html/contact/contact_us/contact/contact_us/contact_us/contact/index.html
一直如此……我认为它停止爬行只是因为它达到了 24,000 页。所有这些页面实际上都有效。真的只需要两页:一页用于客户服务常见问题解答,一页用于联系公司。
我是营销人员,而不是开发人员,所以我只知道这是一个问题。我想知道我们是否可以使用 htaccess 解决这个问题,或者是否还有其他问题。在我看来,所有这些其他页面都需要被删除,而不仅仅是重定向。谢谢。
编辑:添加更多示例用于说明和漫画目的
【问题讨论】:
标签: php html regex .htaccess url