News:

Looking for documentation? Take a look on our wiki

Main Menu

Not generate a 404 error for sub-categories.

Started by worknmn, June 18, 2016, 09:47:54 AM

Previous topic - Next topic

worknmn

Observed on versions 3.0.12 and above.

I show on a demo website http://demo.virtuemart.net/wear/zxczxc

Will not be generated 404 error...

For product - http://demo.virtuemart.net/balldsfsdf-detail

Will not be generated 404 error! It's not funny for SEO!
my site: sagip.ru

jenkinhill

Discussed many times before. That redirect is used so that sales are not likely to be lost. If you want to use the default Joomla error handler then simply deselect "Enable VirtueMart 404 error handling" in Configuration/Shop
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

worknmn

Option "Enable VirtueMart 404 error handling" deselected. That's why i wrote about this error.
my site: sagip.ru

worknmn

Look at code from router. There are all way from none existing URLs show category from first used in menu.

$last_elem = end($segments);
$slast_elem = prev($segments);
if ( (substr($last_elem, -(int)$helper->seo_sufix_size ) == $helper->seo_sufix)
|| ($last_elem=='notify' && substr($slast_elem, -(int)$helper->seo_sufix_size ) == $helper->seo_sufix) ) {

$vars['view'] = 'productdetails';
if($last_elem=='notify') {
$vars['layout'] = 'notify';
array_pop($segments);
}

if (!$helper->use_id ) {
$product = $helper->getProductId($segments ,$helper->activeMenu->virtuemart_category_id);
$vars['virtuemart_product_id'] = $product['virtuemart_product_id'];
$vars['virtuemart_category_id'] = $product['virtuemart_category_id'];
//vmdebug('View productdetails, using case !$helper->use_id',$vars,$helper->activeMenu);
}
elseif (isset($segments[1]) ){
$vars['virtuemart_product_id'] = $segments[0];
$vars['virtuemart_category_id'] = $segments[1];
//vmdebug('View productdetails, using case isset($segments[1]',$vars);
} else {
$vars['virtuemart_product_id'] = $segments[0];
$vars['virtuemart_category_id'] = $helper->activeMenu->virtuemart_category_id ;
//vmdebug('View productdetails, using case "else", which uses $helper->activeMenu->virtuemart_category_id ',$vars);
}



} elseif (!$helper->use_id && ($helper->activeMenu->view == 'category' ) )  {
$vars['virtuemart_category_id'] = $helper->getCategoryId (end($segments) ,$helper->activeMenu->virtuemart_category_id);
$vars['view'] = 'category' ;

} elseif (isset($segments[0]) && ctype_digit ($segments[0]) || $helper->activeMenu->virtuemart_category_id>0 ) {
$vars['virtuemart_category_id'] = $segments[0];
$vars['view'] = 'category';


} elseif ($helper->activeMenu->virtuemart_category_id >0 && $vars['view'] != 'productdetails') {
$vars['virtuemart_category_id'] = $helper->activeMenu->virtuemart_category_id ;
$vars['view'] = 'category';

} elseif ($id = $helper->getCategoryId (end($segments) ,$helper->activeMenu->virtuemart_category_id )) {

// find corresponding category . If not, segment 0 must be a view
$vars['virtuemart_category_id'] = $id;
$vars['view'] = 'category' ;
} else {
$vars['view'] = $segments[0] ;
if ( isset($segments[1]) ) {
$vars['task'] = $segments[1] ;
}
}
my site: sagip.ru

jenkinhill

I'm using VM3.0.17 and it does return 404 when the VM 404 setting is off - this is a test version from SVN.  The next stable public version will be 3.0.18
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

worknmn

You tested local or public site? show me please. I show you on 3.0.16 vm, joomla 3.5.1

http://clip2net.com/s/3zlFN22 - option off

http://m-sumka.ru/katalog/platya/povsednevnye-platya/sdfsdfsdf status 200 OK!

I think need send header's 404, but show category like it used now. It solve all problems.
my site: sagip.ru

juanki

Quote from: jenkinhill on June 18, 2016, 17:09:56 PM
I'm using VM3.0.17 and it does return 404 when the VM 404 setting is off - this is a test version from SVN.  The next stable public version will be 3.0.18

Hello, will 3.0.18 be a public stable version recommended to be used in a live site?. Any estimated date for it to be published? Thanks
Canary islands electronics online shop
http://www.architoner.com