Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jan 2006
    Posts
    88
    Plugin Contributions
    0

    red flag 406 Error and template path in URL

    I just moved a 1.5.1 Zen-Cart site to a new server (HostGator.)

    The following links are generating a 406 error:
    Log Out
    My Account
    Checkout

    In the URLs, the template path is visible, ex:
    https://www.mysite.com/shop/index.ph...default/common

    The server log seems to indicate that the template path is what's causing the error:
    Directory not allowed here

    Any advice for how to clear these errors up? Thank you in advance!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: 406 Error and template path in URL

    Quote Originally Posted by stevensmedia View Post
    I just moved a 1.5.1 Zen-Cart site to a new server (HostGator.)
    Which of the steps in this article did you skip? http://www.zen-cart.com/content.php?...fferent-server

    What's the URL?

    If you sent ENABLE_SSL to 'false' does the problem stop? If so, then your SSL is to blame.
    .

    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
    Jan 2006
    Posts
    88
    Plugin Contributions
    0

    Default Re: 406 Error and template path in URL

    Thank you for you quick reply!

    The step I skipped was running the Fix Key Cache tool. This has now been done:

    Recommendations
    Possible appropriate cache directory for your site is: /full/path/to/public_html/shop/cache

    Actual Information
    Read DIR_FS_SQL_CACHE from includes/configure.php: /full/path/to/public_html/shop/cache
    Found SESSION_WRITE_DIRECTORY in database:

    Now synchronizing...
    Database now contains the following SESSION_WRITE_DIRECTORY:

    Finished.
    (I assume the blank value for SESSION_WRITE_DIRECTORY in the DB is correct. SQL_CACHE_METHOD is set to NONE in configure.php)

    I tried disabling SSL in the two configuration files and the error persisted.

    I looked in my custom template files and noticed that the path (that's apparently causing the problem) was in the code, like this:

    Code:
    <div id="login">
    <?php if ($_SESSION['customer_id']) { ?>
    <a href="<?php echo zen_href_link(FILENAME_LOGOFF, '../../template_default/common', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a><br /><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '../../template_default/common', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>
    <?php
          } else {
            if (STORE_STATUS == '0') {
    ?>
    <a href="<?php echo zen_href_link(FILENAME_LOGIN, '../../template_default/common', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a>
    <?php } } ?>
    
    <?php if ($_SESSION['cart']->count_contents() != 0) { ?>
    <a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '../../template_default/common', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a><br />
    <a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '../../template_default/common', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a>
    <?php }?>
    </div>
    I removed the paths, so the links appear like:
    Code:
    <a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a>
    That fixed the Account and Checkout links---they no longer generate a 406 error.

    The Logoff link also no longer causes a 406 error BUT it also doesn't work--you're not logged out when you click the link.

    A problem with sessions? The cache directory permissions are 755. Here are the store's sessions settings:
    Session Directory /full/path/to/public_html/shop/cache
    Force Cookie Use False
    Cookie Domain True
    Check SSL Session ID False
    Check User Agent False
    Check IP Address False
    Prevent Spider Sessions False
    Recreate Session False
    IP to Host Conversion Status true
    Use root path for cookie path False
    Add period prefix to cookie domain True
    I switched to the "Classic Contemporary Green" template and the problem persisted.

    The URL of the site is: https://www.ritson-sole.com/shop/

    Thanks again for any advice you can provide.

  4. #4
    Join Date
    Jan 2006
    Posts
    88
    Plugin Contributions
    0

    Default Re: 406 Error and template path in URL

    ps. The Fix Key Cache tool returned blank values for SESSION_WRITE_DIRECTORY but the database does contain a value which looks correct: /full/path/to/public_html/shop/cache

  5. #5
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: 406 Error and template path in URL

    Quote Originally Posted by stevensmedia View Post
    ps. The Fix Key Cache tool returned blank values for SESSION_WRITE_DIRECTORY but the database does contain a value which looks correct: /full/path/to/public_html/shop/cache
    No, it should neither be blank nor the literal text '/full/path/to/public_html/shop/cache'.

    It should match whatever you've got in your /includes/configure.php file for DIR_FS_SQL_CACHE
    .

    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.

  6. #6
    Join Date
    Jan 2006
    Posts
    88
    Plugin Contributions
    0

    Default Re: 406 Error and template path in URL

    Sorry for the confusion. The value in the DB DOES match what's in /includes/configure.php file for DIR_FS_SQL_CACHE. (The path does NOT include "/full/path/to"--I'm just using that here to not expose the actual server path.)

    Any other ideas?

  7. #7
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: 406 Error and template path in URL

    Okay, so now the next step is to clearly identify EVERY way in which your site's PHP files are different from the original ZC distribution files.
    .

    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.

  8. #8
    Join Date
    Jan 2006
    Posts
    88
    Plugin Contributions
    0

    Default Re: 406 Error and template path in URL

    Yes, I have a detailed list of this.

    But I wasn't getting this error, with the same files, on the other server...?

  9. #9
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: 406 Error and template path in URL

    Quote Originally Posted by stevensmedia View Post
    But I wasn't getting this error, with the same files, on the other server...?
    I understand that, and I agree that that's frustrating. But nobody here knows exactly the differences between those 2 servers.

    So, there are 2 possibilities:
    a) the problem is still in your own modifications to the code, and the old server configuration let you get away with it.
    b) or there's something misconfigured on your server ... in which case you'll want to obtain a detailed list of all configuration settings for PHP and MySQL and Apache and mod_security and firewalls and vhosts from both servers, and isolate which differences are causing your symptoms.

    I've never seen these sort of symptoms running Zen Cart on Hostgator servers, so it makes me suspicious of your alterations.

    A brand new fresh uncustomized install might be revealing.
    .

    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.

  10. #10
    Join Date
    Jan 2006
    Posts
    88
    Plugin Contributions
    0

    Default Re: 406 Error and template path in URL

    A brand new, fresh, uncustomized install worked without problems.

    I then copied over my customized files from the non-working installation, into the new working install, switched the database configuration to the non-working install's DB, and... everything continues to work.

    So, I assume the problem was due to a corrupted upload when I first moved the site over.

    Thanks for your guidance!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 3
    Last Post: 26 Aug 2012, 07:02 PM
  2. Server Error 406 on EBS Payment Gateway return URL
    By MartinKneeshaw in forum Addon Payment Modules
    Replies: 9
    Last Post: 10 Feb 2011, 08:50 AM
  3. Wierd path error on download file path
    By captainmurph in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 21 Jan 2011, 02:44 PM
  4. error in path (function.session-save-path) after switching servers
    By stitch in forum Installing on a Linux/Unix Server
    Replies: 7
    Last Post: 16 Feb 2010, 09:37 AM
  5. Path and URL locations for directory move of zc install?
    By schwimwastaken in forum General Questions
    Replies: 1
    Last Post: 21 Apr 2009, 07:17 PM

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