VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: n3t on January 15, 2018, 13:15:15 PM

Title: VM3.2.12 - Invalid 404 routing
Post by: n3t on January 15, 2018, 13:15:15 PM
Hi,

seems that invalid routing issue, reported here (https://forum.virtuemart.net/index.php?topic=133502.0), is back in 3.2.x.

To summarize, if you have VM as frontpage of the web, URLs look like /category/sub-category, which is fine, but URL /whatever-else should end with 404, but does not.

In rotuter.php on line 760, at the end of virtuemartParseRoute function there is this code

if (!isset($vars['virtuemart_category_id'])){
  ...
  if(empty($vars['virtuemart_category_id'])) $vars['virtuemart_category_id'] = 0;
  if(empty($vars['view'])) $vars['view'] = 'category';

  if(!isset($vars['limit'])) $vars['limit'] = vmrouterHelper::getLimitByCategory($vars['virtuemart_category_id'],$vars['view']);
}


In other words, "if no category is found from URL set view to category ID 0", which is IMHO wrong, as it disable correct 404 handling. If this code is removed, everything works as expected.

Pavel
Title: Re: VM3.2.12 - Invalid 404 routing
Post by: n3t on January 16, 2018, 22:12:49 PM
Noone meets same issue?
Title: Re: VM3.2.12 - Invalid 404 routing
Post by: Ventsi Genchev on January 17, 2018, 08:08:16 AM
No, n3t. You are not the one.  :)
I've informed Max about this problem. The same thing you can see on the demo site: https://demo.virtuemart.net/

Unfortunately, there is still no solution to this problem so far. But I do not know if the changes you described in the rotuter.php are useful because they probably matter for other functionalities.
Title: Re: VM3.2.12 - Invalid 404 routing
Post by: Milbo on January 17, 2018, 11:12:53 AM
Because there is a 404, if you want to disable the vm 404 handling, then just disable it.

A 404 is NOT defined as "shows 404".

The page can show what you want. The header is the trick. There you should see the 404. So the searchengines and all that see it as 404. But I dont see a reason to show a customer a stupid 404. That is nerdy. A normal person is not interested to see a 404, so the 404 is only visible for bots or devs who check the code.
Title: Re: VM3.2.12 - Invalid 404 routing
Post by: Ventsi Genchev on January 17, 2018, 11:36:52 AM
Hi Max,

Like I had written before, there is no way to disable the vm 404 handling. There is no change when turning on or off "Enable VirtueMart 404 Error Handling".

Also I thoroughly checked the header of my site and demo site (demo.virtuemart.net) and the answer is always 200 OK. It is nowhere to be seen 404. Can I miss some settings?

Thank you!
Title: Re: VM3.2.12 - Invalid 404 routing
Post by: mhuebler on January 20, 2018, 15:21:42 PM
Confirm! No more VM 404 handling possible!