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

Why index.php?option=com_virtuemart instead of 404?

Started by vaskern, June 08, 2013, 11:38:53 AM

Previous topic - Next topic

vaskern

My virtuemart redirects to index.php?option=com_virtuemart instead of showing an error page for incorrect urls.
How can this be changed?

"Search Engine Friendly URLs" and "Use URL rewriting" set to Yes.
PHP: 5.3.25
Joomla!: Joomla! 2.5.11
VM: 2.0.20b

jjk

...because VirtueMart urls are foolproof  ;D. Instead of throwing an error, VM usually displays what it finds in the correct part of the url, i.e. the category view. To see that, just go to a product view in the frontend and replace the last word(s) in your url with some nonsense, i.e. ...testurl. So instead of a 404, your customers will probably see a page where they can find what they were looking for with just another mouse click.

A normal non-sef url looks like this:
...option=com_virtuemart&view=productdetails&virtuemart_product_id=1391&virtuemart_category_id=6

A normal sef url looks like this:
...YourDomain/CategoryName/ProductTitle-detail (or -html, if you change the setting)

The recommended SEF settings are

In Joomla configuration set:

'Search Engine Friendly URLs' = "Yes"
'Adds Suffix to URL' to "No"

In VM2 configuration, set
'SEO Disabled' to "Off" (= unchecked)
'Seo Suffix' to "-detail" (or "shop" or "htm" or whatever you want).  DO NOT leave this field empty. Otherwise switching between categories and products will frequently fail.
'Translate Strings' = "Yes" (checked)
'Use Product and Category IDs' = "Off" (unchecked)


BTW - if you change SEF settings, you will normally have to clear your Joomla and browser cache to pick up the changed settings.

Since you have an index.php? in your url, please also read this:
http://forum.virtuemart.net/index.php?topic=106167.msg354064#msg354064
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

vaskern

Thanks, yes I've noticed sometimes you endup in the correct place even thought the url is not completly correct. And I see after playing around abit that sometimes a 404 is shown. For SEO I suspect its a good thing to return 404 for wrong urls, isnt it?
But my problem is I need a way to redirect an url that vm just redirects to the above adress. And I belive I have all the correct settings. So thought I would do it by using the Joomla redirect manager but it appears not to be working well with the VM urls (cant see any in the "Expired URL" list).
Whats the best way of handling wrong urls in VM?

jjk

Is 'motivuppsala' your shop? I just had a look at that one, but can't reproduce any redirect to 'index.php?option=com_virtuemart'. Maybe you renamed your htaccess.txt to .htaccess meanwhile?
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

vaskern

Thats strange, seems I can type in anything wrong and end up in index.php?option=com_virtuemart..?

jjk

I don't have no other clue at the moment. When I type some garbarge into my browser's url field on my own website or on a fresh Joomla/VirtueMart test site, VM redirects me to the next higher menu level, which usually is the category view. However, search engine crawlers dont' type wrong urls, so it won't affect your SEO.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

PRO

category-name/product_name-detail

IF    you do this   category-name/product_nam999999999999999999999888888888888888e-detail

It will redirect to
category-name/


IF, you have

shop/product-name-detail

and there is no product, it will go to /shop


i just checked & cannot reproduce the problem,

r_ekkie

I have the same.

try:
www.lichtengeluigkopen.nl/werdf
and you go to
www.lichtengeluidkopen.nl/index.php?option=com_virtuemart

PRO

Quote from: r_ekkie on June 15, 2013, 06:47:40 AM
I have the same.

try:
www.lichtengeluigkopen.nl/werdf
and you go to
www.lichtengeluidkopen.nl/index.php?option=com_virtuemart


do you have a menu link to the shop?



r_ekkie


jjk

Quote from: PRO on June 15, 2013, 02:28:13 AM
i just checked & cannot reproduce the problem,

If you click any of the categories at www.lichtengeluidkopen.nl, then delete i.e. the last character of the category name in the url and press enter, you will probably see http://www.lichtengeluidkopen.nl/index.php?option=com_virtuemart. But I don't see why this should create any problem.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

r_ekkie

you get an empty page customers don't get that, I think it should give a 404 or the main categorie view of VM

jjk

I don't see an empty page. If I do what I described in my previous answer, I see a search form, so a customer (they ususally don't type product urls) can use the form to search what he was looking for instead of a 404 error, which doesn't help the customer.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations