Page 1 of 3 123 LastLast
Results 1 to 10 of 42

Hybrid View

  1. #1
    Join Date
    Jan 2010
    Location
    France
    Posts
    279
    Plugin Contributions
    0

    Default path routing problem with the hosting

    Everything starts from this post https://www.zen-cart.com/showthread....search-instead where eventually even another has the same problem of path path

    I have a problem that the hosting service can not resolve, I hope that you will. I stress before it all runs on localhost MAMP but not on the hosting, I made a change this
    (https://pro-webs.net/blog/2010/03/21...tock-products/)
    I get a debug file and rederict not work why?

    PHP Code:
    [03-May-2016 13:29:29 Europe/RomePHP Warning:  Cannot modify header information headers already sent by (output started at /home/balblabla/public_html/includes/templates/mobishop_blue/common/tpl_header.php:230in /home/balblabla/public_html/includes/modules/pages/product_info/main_template_vars.php on line 34
    [03-May-2016 13:29:29 Europe/RomePHP Warning:  Cannot modify header information headers already sent by (output started at /home/balblabla/public_html/includes/templates/mobishop_blue/common/tpl_header.php:230in /home/balblabla/public_html/includes/modules/pages/product_info/main_template_vars.php on line 35
    [03-May-2016 13:29:29 Europe/RomePHP Warning:  require(/home/balblabla/public_html/includes/templates/mobishop_blue/templates): failed to open streamNo such device in /home/balblabla/public_html/includes/modules/pages/product_info/main_template_vars.php on line 180
    [03-May-2016 13:29:29 Europe/RomePHP Fatal error:  require(): Failed opening required 'includes/templates/mobishop_blue/templates' (include_path='.:/usr/lib/php:/usr/local/lib/php'in /home/balblabla/public_html/includes/modules/pages/product_info/main_template_vars.php on line 180 
    I think that hosting has some restrictions but which one? they tell me that the code is wrong, but if it works in localhost as may be the Melanie code?
    Giovanni,
    Zen Cart V1.5.8 + templates ZCA Bootstrap Template

  2. #2
    Join Date
    Feb 2007
    Location
    Pennsylvania
    Posts
    109
    Plugin Contributions
    0

    Default Re: path routing problem with the hosting

    Did you change the path from the localhost to the hosting server?
    Also remove try changing
    PHP Code:
    .:/usr/lib/php:/usr/local/lib/php 

    To
    PHP Code:
    /usr/lib/php:/usr/local/lib/php 
    See if that helps

  3. #3
    Join Date
    Jan 2010
    Location
    France
    Posts
    279
    Plugin Contributions
    0

    Default Re: path routing problem with the hosting

    Hello, thanks for the reply but I do not understand where to change .:/usr/lib/php:/usr/local/lib/phpphp of MAMP which is on the pc runs and sur hosting that hosts the site that does not work , and hosting manager does not know what to do to blame the code that I try to put in /includes/modules/pages/product_info/main_template_vars.php
    Giovanni,
    Zen Cart V1.5.8 + templates ZCA Bootstrap Template

  4. #4
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,684
    Plugin Contributions
    9

    Default Re: path routing problem with the hosting

    the idea that it works in MAMP does not necessarily mean it will work with your hosting company. configuration of shared web servers can be difficult and complex.

    that said, it's pretty clear your redirect is not working. post the code for your redirect. i would make use of the included function zen_redirect which would ensure that the proper configuration gets used (and should work on both your MAMP and on the shared server).
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  5. #5
    Join Date
    Jan 2010
    Location
    France
    Posts
    279
    Plugin Contributions
    0

    Default Re: path routing problem with the hosting

    It is what he said the assistance is not guaranteed to work with us. You can not be a little more clear what I should do maybe where to intervene Thanks

    the code is this

    In /includes/modules/pages/product_info/main_template_vars.php around line 31 find:

    if ( $res->fields['total'] < 1 ) {
    Just below this you will see

    $tpl_page_body = '/tpl_product_info_noproduct.php';
    Replace this line with

    $requeststring = (isset($_GET['cPath']))?'&cPath='. (int)$_GET['cPath']:'';
    header( "HTTP/1.1 301 Moved Permanently" );
    header('location:index.php?main_page=index'.$requeststring);
    Last edited by diamond1; 3 May 2016 at 03:44 PM.
    Giovanni,
    Zen Cart V1.5.8 + templates ZCA Bootstrap Template

  6. #6
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,684
    Plugin Contributions
    9

    Default Re: path routing problem with the hosting

    the error is here:

    No such device in /home/balblabla/public_html/includes/modules/pages/product_info/main_template_vars.php on line 180

    please post line 180.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  7. #7
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: path routing problem with the hosting

    The aim is that if a file does not exist in the DB instead of having an error 302 to a 404 face a rederict 301 to a specific page
    First off "files" do not exist in the DB

    Why don't you leave the ZenCart code alone?

    Use htaccess for what you are seeking
    Zen-Venom Get Bitten

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: path routing problem with the hosting

    ... or, you could try using the built-in Zen Cart functions to perform your task. Change
    Code:
    $res = $db->Execute($sql);
    
      if ( $res->fields['total'] < 1 ) {
    
        $requeststring = (isset($_GET['cPath']))?'&cPath='. (int)$_GET['cPath']:'';
            header( "HTTP/1.1 301 Moved Permanently" );
            header('location:index.php?main_page=featured_products'.$requeststring);
    
      } else {
    to
    Code:
    $res = $db->Execute($sql);
    
      if ( $res->fields['total'] < 1 ) {
        zen_redirect (zen_href_link (FILENAME_FEATURED,  (isset ($_GET['cPath'])) ? ('cPath=' . (int)$_GET['cPath']) : ''), 301);
    
      } else {

  9. #9
    Join Date
    Jan 2010
    Location
    France
    Posts
    279
    Plugin Contributions
    0

    Default Re: path routing problem with the hosting

    Hello Lat9 I tried your solution but it does not change I always have a 404, sorry I can not translate my thoughts. What I mean is that the server does not make the rederict with the first explained solution in this site https://pro-webs.net/blog/2010/03/21...tock-products/ but localhos works on PCs with MAMP except online. Instead the Lat9 solution does not work online and in local host.

    Kobra, zen cart solution makes me a redirect 302 to a 404, but since I have many products obselet the best solution in my case would be a collective 301 final.
    Giovanni,
    Zen Cart V1.5.8 + templates ZCA Bootstrap Template

  10. #10
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,684
    Plugin Contributions
    9

    Default Re: path routing problem with the hosting

    diamond1,
    my mistake. line 180 is not the culprit. the first error (warning) in the log states line 34 which is where the headers/redirect code is.

    i would make the change as indicated by lat9 above.

    ok, i'm seeing that did not work. i had a feeling it would not. the problem is that the header information has already been sent here:

    includes/templates/mobishop_blue/common/tpl_header.php:230

    which means the redirect would need to come before that line of code.

    in looking at that file in the default template, the code is much smaller... maybe post that and lets see if we can move the redirect there.

    best.
    Last edited by carlwhat; 4 May 2016 at 03:09 PM.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v154 (77) Problem with the SSL CA cert (path? access rights?) - Solved
    By nuganics in forum PayPal Express Checkout support
    Replies: 0
    Last Post: 28 Jan 2015, 02:23 AM
  2. Double Path Problem with BlueHost
    By cwhittaker in forum Installing on a Linux/Unix Server
    Replies: 15
    Last Post: 24 Jan 2010, 10:58 PM
  3. Hide side box with banner and Routing image
    By ryanb4614 in forum Basic Configuration
    Replies: 1
    Last Post: 14 Feb 2008, 03:37 AM
  4. help my physical path on Yahoo hosting
    By lina0962 in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 7 Jun 2006, 04:43 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR