【问题标题】:My osclass links are working properly but returns 404 error when checked我的 osclass 链接工作正常,但检查时返回 404 错误
【发布时间】:2013-12-03 07:58:16
【问题描述】:

我使用 osclass 创建了二手车网站 www.carsangrah.com。

某些链接 (http://www.carsangrah.com/buy-used-cars_maharashtra-r781510) 运行良好,但在检查 http://validator.w3.org/checklink 时返回断开的链接(404 错误)。

Google 和 Bing 网站管理员也显示为 404 错误。我无法在 Google 和 Bing 中索引这些链接。请提出解决方案。

谢谢

【问题讨论】:

    标签: http-status-code-404 google-search-console broken-links osclass


    【解决方案1】:

    这是 oc-includes/osclass/controller 然后 search.php 然后找到这个的解决方案

                    if( count($aItems) === 0 ) {
                    header('HTTP/1.1 404 Not Found');
                }
    

    替换if( count($aItems) === 0 ) with if( count($aItems) === -1 )。 修复

    【讨论】:

      【解决方案2】:

      默认情况下,如果搜索有 0 个结果,则 Osclass 会返回 404 状态代码,您不希望搜索引擎索引没有任何有用内容的页面。

      如果是链接,则在带有列表的搜索结果页面上产生,返回 200 状态代码。

      【讨论】:

      • 对不起,我没听懂。让我澄清我的问题。提供的是有效的,它的工作,即没有 404 错误。由于 404,谷歌仍然显示抓取错误。
      【解决方案3】:

      啊,这解释了我看到的 404 问题。我将把它记录为错误,因为没有返回列表并不意味着 404 它意味着没有列表。 404 是找不到页面,这显然是错误的,因为服务器正在从服务器传送一个 html 页面。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2017-08-16
        • 1970-01-01
        • 1970-01-01
        • 2020-02-07
        • 1970-01-01
        • 2013-03-01
        • 1970-01-01
        相关资源
        最近更新 更多