News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Virtuemart great problem with 404 pages

Started by Jaspers, August 09, 2016, 00:05:37 AM

Previous topic - Next topic

Jaspers

Hello everybody. I just noticed a great problem with virtuemart. If you choose the home page type any of Virtuemart pages and type some nonsense, like site.com/asdasdasdasd - that won't show 404 page. And that problem appears in all virtuemart pages, including products. Аrе there any fixes?
I have checked in all my sites with virtuemart. All sites have the same problem..  :(

MagikCommerce


Jaspers

Greetings. In this topic and all forum there are many ways to get around the problem. No some hacks and fixes. I would like to fix finally this problem.

Jaspers

#3
I'm not good at php. Is there a code like "If the url is wrong (not a virtuemart category)" or something similar?

GJC Web Design

where do u end up now when there is a non existing page??
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Jaspers

#5
If i go to somearticle/asdasdasd - that displays an error 404, fage not found.
But when i go to some VM category and type fake url, like :site.com/vmcategory/asdasdasd - that redirects me to site.ru/vmcategory.html.
When i type some fake url like site.com/asdasdasd - that displays the page without some redirects and error - 200 OK, because my home page type is choosed "Virtuemart category". When i choose home page type to some joomla material and type site.com/qweqweqwe - that displays error page 404, as it should.

So i have another question : where i can find the code which is responsible for this redirect to category?

GJC Web Design

is this selected?

Enable VirtueMart 404 error handling  ? VM config
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Jaspers

Yeah, of course. But when i go to components/com_virtuemart/virtuemart.php after  if (VmConfig::get('handle_404',1)) { i write echo "qwerty"; and that does not display "qwerty in category. So i think, that this option in VM is not working.

GJC Web Design

just tested

if I uncheck 'Enable VirtueMart 404 error handling' and try a non existent VM page I get a standard Joomla 404

If I check it , sef on, try a none existent product I am redirected to the VM frontpage or if the cat slug is in the url to that cat

if I try a non existent cat page (sef url) I get a std. 404

if I use non SEF urls to non existent cats  I go the VM frontpage

So for me it works

clean J3.6.2/VM3.0.16

trying  print 'Debug Line '.__LINE__.' 404 <pre>'; print_r (VmConfig::get('handle_404')); print "</pre><br />\n"; it does change with the admin change
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

PRO

Quote from: GJC Web Design on August 09, 2016, 19:57:18 PM

if I try a non existent cat page (sef url) I get a std. 404

BUT!   not when any vmart alias is before it

for example. if your shop alias is

/shop


then you type in

/shop/axnlksdlklkfjkldgfj     you will NOT get a 404
what you get is    /shop   display, BECAUSE vmart/ joomla has NO idea what the "view" is supposed to be to even know if its a fake category.

& OP,
This really does not create a SEO problem. The canonical url is in the head of the doc.

PRO

Quote from: Jaspers on August 09, 2016, 17:31:54 PM
Yeah, of course. But when i go to components/com_virtuemart/virtuemart.php after  if (VmConfig::get('handle_404',1)) { i write echo "qwerty"; and that does not display "qwerty in category. So i think, that this option in VM is not working.

because you need to change it in
views/category/view.html.php

if (VmConfig::get('handle_404',1)) {
               $app->redirect(JRoute::_('index.php?option=com_virtuemart' . $categoryLink . '&error=404', FALSE));
            } else {
               JError::raise(E_ERROR,'404','Not found');
            }


BUT! this will not work UNLESS joomla knows your in the vmart component

PRO

Quote from: Jaspers on August 09, 2016, 13:09:58 PM
I'm not good at php. Is there a code like "If the url is wrong (not a virtuemart category)" or something similar?


yes this can be done ,

BUT! you have to think.

Someone who uses google adwords, and google gives additional tracking parameters, should they 404?

Milbo

Quote from: Jaspers on August 09, 2016, 00:05:37 AM
Hello everybody. I just noticed a great problem with virtuemart. If you choose the home page type any of Virtuemart pages and type some nonsense, like site.com/asdasdasdasd - that won't show 404 page. And that problem appears in all virtuemart pages, including products. Аrе there any fixes?
I have checked in all my sites with virtuemart. All sites have the same problem..  :(

This is not an error, there exists unlimited urls for any canonical url. Because when you add something to a valid url, it is just handled as parameter. When the parameter is not used within the view, then the parameter is not without any effect => "unlimited" valid urls and that is not an error, that is by design.
Searchengines handle that completly correct. 404 is actually a code for an not valid link, but our job is to assure that there are no non valid links.
Remind the old times, when you wrote a page with static html, and you used a link to a nonexisting file, for that you have the 404. But in a CMS, you always open the /index.php, which is always valid.

So even our simulation of 404 is nonsense, it should be 303 or so, actually.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Jaspers

Thank you very much for replies.
Ok, now i understand, that this is not a problem, and everything works properly.
My default site page is selected virtuemart category page. So when i go to site.com/asdasdasd  -  that does not redirect me to site.com, but there is a canonical link. So i think this would not create a problem with seo.
So lets summarize.
When the default site page is choosed some of VM pages:
When the defaul site page is choosed some joomla standart page, for example some material, than site.com/asdasd will show page 404, but virtuemart pages will work as with defaul vm page.
In spite of unchecked "Enable VirtueMart 404 error handling", the VM will always redirect and does not show the 404 page. I Don't know why, this does not work for me, tried to uncheck this function.Ineffectually.  :) J3.6.0 VM 3.0.16

Also i use a plugin "Canonical links all in one", there is an option: Permanent Redirect to the canonical link. With this option all product pages correctly redirect to canonical link, but "site.com/asdasd" does not redirect to canonical "site.com", i don't know why  :)

Milbo

I think we dont have a canonical for "home".
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/