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.
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.
Re: path routing problem with the hosting
230 in the line of tpl_header.php files I have this
PHP Code:
</div>
<?php require(DIR_WS_MODULES . $template_dir . '/categories_popup.php');
echo $content; ?>
</div>
Re: path routing problem with the hosting
i'm sorry, you have posted 4 lines of code. which one specifically is line 230?
perhaps post the whole file. unless the $content has the headers info in there.
Re: path routing problem with the hosting
Sorry
PHP Code:
<?php
/**
* Template designed by 12leaves.com
* 12leaves.com - Free ecommerce templates and design services
*
* Common Template
*
* @package languageDefines
* @copyright Copyright 2009-2010 12leaves.com
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_header.php 4813 2006-10-23 02:13:53Z drbyte $
*/
?>
<?php
// Display all header alerts via messageStack:
echo '<div class="messages-st">';
if ($messageStack->size('header') > 0) {
echo $messageStack->output('header');
}
if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) {
echo htmlspecialchars(urldecode($_GET['error_message']));
}
if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
echo htmlspecialchars($_GET['info_message']);
} else {
}
echo '</div>';
// test if box should display
$show_languages= true;
if ($show_languages == true) {
if (!isset($lng) || (isset($lng) && !is_object($lng))) {
$lng = new language;
}
reset($lng->catalog_languages);
$languages_array = array();
$current_language = '';
while (list($key, $value) = each($lng->catalog_languages)) {
$languages_array_popup[$key] = $value['name'];
}
foreach ($languages_array_popup as $k => $v){
if ($k == $_SESSION['languages_code']) {
$current_language = $v;
}
}
}
?>
<!--bof-header logo and navigation display-->
<?php
if (!isset($flag_disable_header) || !$flag_disable_header) {
?>
<div id="headerWrapper">
<!--bof-branding display-->
<div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>
<!--eof-branding display-->
<div>
<!--bof-header ezpage links-->
<div class="topper-menu float-right hidden-phone">
<?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
<?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
<?php } ?>
</div>
<!-- Languages/currency -->
<div class="languages-wrapper">
<div class="top-item visible-phone">
<a id="menu_more" class="item-icon" href="#"> </a>
<div id="menu_more_popup" class="popup popup-win pull-right">
<img class="close-pic float-right" src="<?php echo ($template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images'). '/close_pic.gif'); ?>" alt="close" />
<!--bof-header ezpage links-->
<?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
<?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
<hr />
<?php } ?>
<?php if ($_SESSION['customer_id']) { ?>
<a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a><br />
<a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a>
<?php
} else {
if (STORE_STATUS == '0') {
?>
<a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a>
<?php } } ?>
<!--eof-header ezpage links-->
</div>
</div>
<?php
$languges_object = new language;
if (count ($languges_object->catalog_languages) > 1){
?>
<div class="languages">
<?php require($template->get_template_dir('tpl_languages_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_languages_header.php'); ?>
<div id="langPopup" class="popup popup-win">
<img class="close-pic float-right" src="<?php echo ($template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images'). '/close_pic.gif'); ?>" alt="close" />
<?php require(DIR_WS_MODULES . zen_get_module_directory('header_languages.php')); ?>
</div>
</div>
<?php
}
?>
<?php
if (isset($currencies) && is_object($currencies) && count ($currencies->currencies) > 1){
?>
<div class="currency">
<?php require($template->get_template_dir('tpl_currency_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_currency_header.php'); ?>
<div id="currPopup" class="popup popup-win">
<img id="close-pic" class="close-pic float-right" src="<?php echo ($template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images'). '/close_pic.gif'); ?>" alt="close" />
<ul class="list-popup">
<?php foreach ($currencies_array_popup as $k=>$v) { ?>
<li><a href="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); if ((stripos($_SERVER['REQUEST_URI'], '.php')) === false ) { echo "?";} else {echo "&"; }?><?php echo 'currency='.$k; ?>"><?php echo $v; ?></a></li>
<?php }?>
</ul>
</div>
</div>
<?php
}
?>
</div>
<!--eof-header ezpage links-->
<div class="clearRight"></div>
<?php
require($template->get_template_dir('tpl_top_nav.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_top_nav.php');
?>
<?php
if ($this_is_home_page) {
if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
if ($banner->RecordCount() > 0) {
?>
<div id="bannerOne" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
}
}
}
?>
</div>
<div class="clearBoth"></div>
<!-- tools section -->
<div class="tools-wrp">
<div id="tools_wrapper" class="align-center">
<div id="search-panel">
<div class="float-left td-search-header">
<div class="search-header float-left">
<?php require($template->get_template_dir('tpl_search_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_search_header.php');?>
<div class="advanced_search float-left">
<a href="index.php?main_page=advanced_search"><?php echo HEADER_ADVANCED_SEARCH; ?></a>
</div>
</div>
</div>
<div class="cart-header-wrapper">
<!-- header cart section -->
<table class="align-center cart-header">
<tr>
<td></td>
<td class="cart-img-td">
<?php require($template->get_template_dir('tpl_shopping_cart_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_shopping_cart_header.php');
echo $content;?>
</td>
<td id="delim"></td>
<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
<td class="orange-link">
<a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a>
</td>
<?php } else { ?>
<td class="blue-link">
<a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a>
</td>
<?php } ?>
</tr>
</table>
</div>
</div>
</div>
<!-- mobile header -->
<div id="top_nav_mobile">
<div id="tab_nav_mobile">
<ul class="list-style-none">
<li class="tm-catalog <?php echo $active;?>">
<span class="dlm"></span>
<a id="catalog"><?php echo '<img src="'. $template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images') . '/spacer.gif" width="50" height="50" alt="" />'; ?></a>
</li>
<?php
if ($current_page_base == 'account' || $current_page_base == 'login' || $current_page_base == 'account_edit' || $current_page_base == 'address_book' || $current_page_base == 'account_password' || $current_page_base == 'account_newsletters' || $current_page_base == 'account_notifications') { $active = 'tab-active';
} else { $active = '';
}?>
<li class="tm-account <?php echo $active;?>"><span class="dlm"></span><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo '<img src="'. $template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images') . '/spacer.gif" width="50" height="50" alt="" />'; ?></a></li>
<?php
if ($current_page_base == 'shopping_cart') { $active = 'tab-active'; $item_id = '';
} else { $active = ''; $item_id = 'cart-icon';
}?>
<li class="tm-cart <?php echo $active;?>"><span class="dlm"></span>
<a class="<?php echo $item_id; ?>" href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo '<img src="'. $template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images') . '/spacer.gif" width="50" height="50" alt="" />'; ?>
<?php if ($product_amount > 0) { ?><span class="cart-amount"><?php echo $product_amount; ?></span><?php } ?>
</a>
</li>
<?php
if ($current_page_base == 'advanced_search') { $active = 'tab-active';
} else { $active = '';
}?>
<li class="tm-search <?php echo $active;?>"><span class="dlm"></span><a href="index.php?main_page=advanced_search"><?php echo '<img src="'. $template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images') . '/spacer.gif" width="50" height="50" alt="" />'; ?></a></li>
</ul>
</div>
<?php require(DIR_WS_MODULES . $template_dir . '/categories_popup.php');
echo $content; ?>
</div>
<!-- /mobile header -->
<!-- cart popup -->
<div id="cart_popup" class="cart-dropdown-wrapper popup">
<div class="cart-tab-wrapper"><img src="<?php echo $template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images')?>/spacer.gif" width="1" height="1" alt="" /></div>
<div class="popup-border">
<div class="content-wrapper">
<div class="cart-scrolling-wrapper">
<?php require($template->get_template_dir('tpl_shopping_cart_popup.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_shopping_cart_popup.php');
echo $content; ?>
</div>
<div class="popup-cart-link-box">
<a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL')?>"><?php echo CART_POPUP_VIEW_CART; ?></a>
<a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a>
</div>
</div>
</div>
</div>
<!-- /cart popup -->
</div>
<!-- /tools section -->
</div>
<?php } ?>
Re: path routing problem with the hosting
line 230 is:
<?php require(DIR_WS_MODULES . $template_dir . '/categories_popup.php');
i do not believe:
categories_popup.php
is part of the base package. and i am unfamiliar with this template and what that script does. you can try commenting that line out as such:
<?php //require(DIR_WS_MODULES . $template_dir . '/categories_popup.php');
but i am not sure if that will work nor what other cascading effect it may have. you can try it and see what happens.
also, please post your website URL.
best.
Re: path routing problem with the hosting
Thanks for the reply, I have a responsive template and
PHP Code:
<?php require(DIR_WS_MODULES . $template_dir . '/categories_popup.php');
It serves to open the pop-up categories.
Even if I give you the link of the website you can not see the error that because I can not apply the code to the site if it does not work. But again I say, in localhost the code works does a rederict 301 to ppagina that imposed if the product does not exist, then I think it's a setting you want to modify or adapt the code to the server / includes / modules / pages / product_info / main_template_vars .php
Re: path routing problem with the hosting
Quote:
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.
The following in a htaccess will redirect any non file/missing page to your index.php page
Code:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ / [L,QSA]
</IfModule>
Re: path routing problem with the hosting
Hello Kobra, it's okay I put nell'htaccess, but I would like to understand why it does not work the 301 and I get a double-header in response to live instead in localhost does rederict. Then how come if I have a product that does not exist I get a 302 to a 404 error as I think it is not normal ricere an error 302 to a 404.
Re: path routing problem with the hosting
Quote:
Originally Posted by
diamond1
Hello Kobra, it's okay I put nell'htaccess, but I would like to understand why it does not work the 301 and I get a double-header in response to live instead in localhost does rederict. Then how come if I have a product that does not exist I get a 302 to a 404 error as I think it is not normal ricere an error 302 to a 404.
i can think of a few reasons why it works in your localhost and not in live. first would be the difference in the configuration of the server. second would be the data in your database is different on your localhost v the live server. third, the code on the 2 machines, which you think is the same, may be different.