Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Code Matters / Bug Reports / [Duplicate] My homepage deindex from google due to noindex tags

[Duplicate] My homepage deindex from google due to noindex tags

Locked

Started by alvalong on 13 Apr 2008, 12:16 AM · Views: 1,958

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
13 Apr 2008, 12:16 AM
#1
alvalong avatar

alvalong

New Zenner

Join Date:
Feb 2008
Posts:
74
Plugin Contributions:
0

Post #1 by alvalong

I create a shopping site and start to get sale. i happy. Suddently my home page deindex from google ,allmost all sale gone. calamity a month pass, i lost both passion and sale. but finally i found my homepage have this "<meta name="robots" content="noindex, nofollow" />" it is reason. WHY? My site hacked? after checking,no file changed.
BUT WHY? I found this:$categories->RecordCount() return < or = 0 so $robotsNoIndex = true; then output <meta name="robots" content="noindex, nofollow" />

why this happen to homepage? i check other site ,all work. WHICH make $categories->RecordCount() not >0 ? in my homepage?:shocking::frusty::oops:
i already take out robotsNoIndex = true. but it is not final resolve. i wanna find why to avoid it in future.

// from init_add_crumbs.php
if (isset($cPath_array) && isset($cPath)) {
  for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
    $categories_query = "select categories_name
                           from " . TABLE_CATEGORIES_DESCRIPTION . "
                           where categories_id = '" . (int)$cPath_array[$i] . "'
                           and language_id = '" . (int)$_SESSION['languages_id'] . "'";

    $categories = $db->Execute($categories_query);
//echo 'I SEE ' . (int)$cPath_array[$i] . '<br>';
    if ($categories->RecordCount() > 0) {
      $breadcrumb->add($categories->fields['categories_name'], zen_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
    } else {
      // if invalid, set the robots noindex/nofollow for this page
      $robotsNoIndex = true;
      break;
    }
  }
}


//from html_header.php
<?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance' || $robotsNoIndex === true) { ?>
 <meta name="robots" content="noindex, nofollow" />
<?php } ?>
13 Apr 2008, 12:35 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #2 by drbyte

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.