My osclass links are working properly but returns 404 error when checked

1k views Asked by At

I have created used car website www.carsangrah.com using osclass.

Some links (http://www.carsangrah.com/buy-used-cars_maharashtra-r781510) are working perfect but returns broken link (404 error) when checked on http://validator.w3.org/checklink.

Google and Bing webmaster also showing as 404 error. I am not able to index these links in Google and Bing. Please suggest a solution.

Thanks

3

There are 3 answers

1
Carlos Garcia de Marina On

Osclass by default if a search have 0 results it returns 404 status code, you don't want to search engines index pages without any useful content.

If a link, results on a search results page with listings, 200 status code is returned.

0
Robert On

Ah that explains the 404 issues I am seeing. I am going to log this as and error as no listings returned does not mean 404 it means no listings. 404 is page not found which is clearly wrong as the server is delivering a html page from the server.

0
emuigai On

Here is the solution got to oc-includes/osclass/controller then search.php then find this

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

replace if( count($aItems) === 0 ) with if( count($aItems) === -1 ). that fixes