Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2010
    Posts
    4
    Plugin Contributions
    0

    Default [Not a bug] HTTP 404 for spiders with Prevent Spider Sessions enabled

    Hi all,

    I'm using the latest version of Zen Cart (1.3.9h) and just found some issues with spiders. When I review the apache log on my server I see all GET's by spiders (Google, Bing, Yahoo) returned with a 404. When I try the "Fetch as a Google Bot" in webmaster tools it also receives a 404. This behavior stops when I disabling the setting "Prevent Spider Sessions".

    The problem with disabling this setting is that every URL is appended with the zenid=<sessid> tag which is not how you want search engines to index your site. As a temporary workaround I disabled the setting "Prevent Spider Sessions" and modified the function zen_href_link in so it no longer adds the zenid parameter when the user agent is a spider.
    This is not really a good solution as in the Who's Online page the search engines are no longer highlighted and this is solving the symptoms, not the issue. So that's why I'm opening this topic right now.

    I tried to narrow down the source of the 404 to the code related to the prevent spider session in init_sessions.php by commenting out the following chunk:

    PHP Code:
     if (isset($_GET['zenid']) && $_GET['zenid'] != '') {
          
    $tmp = (isset($_GET['main_page']) && $_GET['main_page'] != '') ? $_GET['main_page'] : FILENAME_DEFAULT;
          @
    header("HTTP/1.1 301 Moved Permanently");
          @
    zen_redirect(@zen_href_link($tmp, @zen_get_all_get_params(array('zenid')), $request_typeFALSE));
          unset(
    $tmp);
          die();
        } 
    This has no influence in the behavior.

    When I copy the URL in the apache log to my browser I get the page I want so it has to be some error in the script caused by the Prevent Spider Session setting.

    Any ideas where this behavior comes from?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: HTTP 404 for spiders with Prevent Spider Sessions enabled

    I can't replicate the problem you're alleging.

    What's the exact URL you're complaining about?
    .

    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.

  3. #3
    Join Date
    Nov 2010
    Posts
    4
    Plugin Contributions
    0

    Default Re: HTTP 404 for spiders with Prevent Spider Sessions enabled

    Hi,
    Thanks for your reply. This issue exists for all the pages on my zen cart store, not just a few off them.

    This is what I get when I use the fetch as a google bot tool on the google webmasters website:

    Code:
    HTTP/1.1 404 Not Found
    Date: Wed, 24 Nov 2010 20:28:13 GMT
    Server: Apache
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma: no-cache
    Set-Cookie: zenid=sessid; path=/shop; domain=.www.domain.tld; HttpOnly
    Vary: Accept-Encoding
    Content-Encoding: gzip
    Content-Length: 20
    Keep-Alive: timeout=15, max=100
    Connection: Keep-Alive
    Content-Type: text/html; charset=iso-8859-1

  4. #4
    Join Date
    Nov 2010
    Posts
    4
    Plugin Contributions
    0

    Default Re: HTTP 404 for spiders with Prevent Spider Sessions enabled

    Hi guys,

    I started to debug this further and apparently this was caused by a modification I made. I improved some checks regarding sessions and now this is no longer a problem.

    Thanks anyway for your help!

    Best regards

 

 

Similar Threads

  1. 404 error on IE with Friendly HTTP Messages enabled
    By derykR in forum Addon Payment Modules
    Replies: 5
    Last Post: 30 Mar 2011, 09:07 AM
  2. Replies: 5
    Last Post: 15 Jan 2008, 07:27 PM
  3. Prevent Spider Sessions
    By dealbyethan.com in forum Basic Configuration
    Replies: 18
    Last Post: 6 Jan 2007, 06:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg