News:

Looking for documentation? Take a look on our wiki

Main Menu

VM3.2.12 - Invalid 404 routing

Started by n3t, January 15, 2018, 13:15:15 PM

Previous topic - Next topic

n3t

Hi,

seems that invalid routing issue, reported here, 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

n3t


Ventsi Genchev

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.
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

Milbo

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Ventsi Genchev

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!
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English