VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Security (https) / Performance / SEO/ SEF issues VM 1.1 => Topic started by: Forrest on April 10, 2010, 03:34:52 am

Title: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: Forrest on April 10, 2010, 03:34:52 am
One of the most popular, repeated questions asked on this forum is in regards to SEF issues causing 404 and 500 page errors.

The first thing to do is identify that this error is in fact due to turning on SEF. Since this thread will be about SEF issues, please verify that your site links in question work fine with SEF off (Disable your Joomla SEF, and or your component SEF).

---------------------------------

1. The most common issue I see is the incorrect usage of VM component links in Joomla menu systems.
Symptoms:

For SEF to work properly, and for Joomla module assignments in VM, you need to have a primary/master link to VM component. When you first set up Virtuemart, you should assign it a menu link in a Joomla Menu.

Typically you may name this link "Shop" or "Store", though you can name it whatever you want to. Make sure you assign it an alias (no spaces, lowercase).

If you have not done this, or did not do this before you created Joomla menu links to category and/or product pages, then you likely will have problems.

Never created a Joomla menu link to VM component: If you never create a link to VM component in Joomla, then VM assigns itself an Itemid of 1. Joomla uses Itemid's to assign modules. In other words, to assign modules, you need to have a menu item to assign it to! Not having a link to VM in Joomla menu system will not give you any control over your modules you may want to assign to VM pages. Likewise, when you turn on SEF, you likely will encounter redirect issues during checkout, since having an itemid is crucial to the redirect process. All you need to do is create a Joomla menu link to the VM component. Do not fill in any of the parameter values for the menu item. You can now turn on your SEF and test again!

I did create a Joomla menu link to VM component: If you have created one or more Joomla menu link(s) to the VM component, then likely you did this before creating a primary/master link to VM component. Essentially Joomla will only use ONE Itemid for Virtuemart component. This Itemid is considered to the the ROOT of your store to Joomla with SEF on. To troubleshoot, you will first need to find WHAT ITEMED is Joomla using as your VM primary/master Itemid.
a. Turn your SEF off.
b. Create a Joomla article page, and enable the Virturemart Module to show on that page, with the "Show All Products" enabled.
c. Click on the "Show All Products" link in module on the article page.
d. In the URL of "Show All Products" you will see an Itemid. This itemid is what Joomla is using as your store root.
e. Go to your Joomla menu Manager and find this id number in your Joomla menus.
f. Take this link and:

What you have done is now found your master Itemid for VM, and labeled this as store/shop/etc, and put it on a main/top level in your menu, with no VM parameters assigned.
You should be able to turn back on your SEF and see everything like your categories and products, checkout, etc, are under your Joomla assigned VM root of yoursite.com/store/ or yousite.com/shop/ or similar.


---------------------------------

2. Your template is not developed correctly.
Symptoms:

While I cannot help you with your template, you can easily find out if it's a template issue. With SEF on, change your Joomla template to a template provided in the Joomla installation package, like BEEZ. If you find that your 500 errors are gone, then it is a template design/architecture issue, and you should contact your template developer.


---------------------------------

3. You are using a 3rd party SEF component.
Symptoms:

I cannot help you at all with 3rd party SEF if these other solutions posted here do not help. You best bet is to contact the SEF developer directly (on their forum or email) for a solution.


---------------------------------

4. Your domain name repeating in URL (dup domains).
Symptoms:

You did not put a trailing slash "/" in the URL settings of your VM config. Please make sure both URL and Secure URL settings have a trailing slash. IE: http://www.domain.com/


---------------------------------

5. Lack of www in domain names.
Symptoms:

Set your VM URL settings (in VM admin) to use www in the domain. Likewise, you can use .htaccess to force the use of www on non-www requests.

Add this code at bottom of .htaccess, for both http, https:


###### Added by Forrest to insure AJAX cart works by force of www
#
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTPS} =on
RewriteRule .* https://www.%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTPS} !=on
RewriteRule .* http://www.%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
#
########## End - Addition by Forrest


If you want to specify ONE domain or BY domain instead use this:
Note: make sure you repalce "YOURDOMAINHERE" with your domain name without www.

###### Added by Forrest to insure AJAX cart works by force of www
#
RewriteCond %{HTTP_HOST} ^YOURDOMAINHERE\.com
RewriteCond %{HTTPS} =on
RewriteRule .* https://www.%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^YOURDOMAINHERE\.com
RewriteCond %{HTTPS} !=on
RewriteRule .* http://www.%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
#
########## End - Addition by Forrest


---------------------------------

6. .htaccess is not set up correctly when your site is in a sub folder.
Symptoms:

If you just turned on SEF, and renamed htaccess.txt to .htaccess, then you will want to turn on mod_rewrite and also specify the sub-folder in which your installation sits. To turn them on, just uncomment them (remove "#")

#  mod_rewrite in use
RewriteEngine On

RewriteBase /yoursubfolder


---------------------------------

7. router.php and custom VM hacks
Symptoms:

If you are using router.php, and problem 1 in this post did not solve your issue, then you may have a hack installed that the router.php was not designed to handle. Router.php was designed with specific VM pages, native to VM. If you add new functions to VM using hacks, then router.php will not know how to handle these new functions and pages. You will need to modify router.php to support them. Likewise, router.php has a few known issues, like a redirect issue during checkout when adding new shipping addresses, and I believe also with "Ask a Product Question".


---------------------------------

Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: shv_rk on May 07, 2010, 12:44:23 pm
Hello,
Not sure if it is correct thread for my question/problem!
I have 2 main vm menu item in the joomla main menu. first one which is my main vm store lists all my products and have sub-menus for different categories. all these work fine with and without SEF.

The other VM menu item in the joomla main menu is "manufacturers" which lists all manufacturers. This is template page which i have created myself by adding manufacturer module into it.   
this page lists all manufacturer and clicking on the readmore should show manufacturer details. however, when SEF is turned on it, it redirects to the home page and shows manufacturer details in the home page.
this page is even working fine with SEF on localhost!
below is part of manufacturer page, the rest is exactly like manufacturer module:
Code: [Select]
<div class="manufacturerListTitle">

<?php $manufacturer_link "index.php?option=com_virtuemart&page=shop.browse&manufacturer_id=".$manufacturer->manufacturer_id."&Itemid=3"?>
<h5>

<a href="<?php echo $manufacturer_link ?>">
        <?php echo $manufacturer->mf_name?> </a>
</h5>
</div>
<div class="clear"></div>

<div class="manufacturerShortDescription">
<?php echo $manufacturer->mf_email ?>
</div>
</div>
<div class="manufacturerListRightContainer">
<div class="manufacturerListImage">
<a
href="<?php echo "index.php?option=com_virtuemart&page=shop.browse&manufacturer_id=".$manufacturer->manufacturer_id."&Itemid=3"?>">
<img
src="images/manufacturersImage/<?php echo $manufacturer->manufacturer_id?>.jpg"
alt="<?php echo $manufacturer->mf_name;?>"> </a>

</div>
Any suggestions?
btw: VM pagination does not work properly when joomla SEF is running and even without sh404SEF!

I am using
sh404SEF  version: 1.5.8.432 -
VM: 1.1.4
joomla: 1.5
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: Forrest on May 07, 2010, 23:16:10 pm
How about a link to site?
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: shv_rk on May 08, 2010, 11:10:33 am
unfortunately, our website is not published yet, and I do not have permission to do it so before it is running properly!
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: Forrest on May 08, 2010, 21:02:55 pm
I would mess with your Itemid=3 in manufacturer source.
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: shv_rk on May 09, 2010, 16:01:31 pm
Yeah already tryout that.. no hope!  :-\
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: shv_rk on May 10, 2010, 14:03:56 pm
even original manufacturer module does not work fine with sh404sef.
it keep directing to index pagw
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: Forrest on May 10, 2010, 20:39:40 pm
Maybe a sh404sef issue? I do not use sh404sef, so I'm not of much help with this.
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: beltoforion on June 05, 2010, 16:39:04 pm
It would be nice to see a tutorial about setting up SEO/SEF in virtuemart. or is there one already ? :O
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: joshmayer on March 06, 2011, 18:36:51 pm
niche share thanks guys..
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: Joomla.weblap on March 29, 2011, 19:11:59 pm
I draw your attention to it
http://forum.joomla.org.hu/virtuemart-keresooptimalizalas-t12587.html (http://forum.joomla.org.hu/virtuemart-keresooptimalizalas-t12587.html)
without sef unique keywords descriptions to the products
Excuse me for the bad English

Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: JoomJohnny5 on April 21, 2011, 10:25:41 am
Forrest, we cannot thank you enough. You are the man with the master plan.

Was battling with 404 errors during checkout process for a week, but I found your post and the primary/master link relationship was the problem.

Will pass this on.  Keep rocking good people.
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: nikosa on May 02, 2011, 23:35:08 pm
hello,can sb explain me how this is done

"Create a Joomla article page, and enable the Virturemart Module to show on that page, with the "Show All Products" enabled."

do you mean to create a menu item linked to vm module?and where do i find "show all products"??
thank you
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: valoran on May 19, 2011, 17:48:19 pm
Thank you soo much dude, I tried it and it worked fine. But after a few days I decided it's an overkill to use SEF for my small project, but I still wanted to thank you!
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: loppan on May 30, 2011, 21:46:12 pm
hello,can sb explain me how this is done

"Create a Joomla article page, and enable the Virturemart Module to show on that page, with the "Show All Products" enabled."

do you mean to create a menu item linked to vm module?and where do i find "show all products"??
thank you

I did like this :

Created a new article

Created a new menu item (named SEFTEST) pointing to that article

Activated the virtuemart module on that article page (mod_virtuemart_1.1.8.j15)

Now I got the "Show all products" link.

However, I still cannot get it to work. My Checkout link gives error 404.

I have my VM item ID, and I have a link to it in my main joomla menu (Same menu as my "default" page (HOME) are located in).

Any ideas what I could be missing? I did follow Forrest's advice #1 very carefully. His other suggestions does not apply to me.

Truly greatful for some help, as usual :).

Best regards Peter

EDIT :

Here's my checkout URL without SEF on :

mydomain.org/index.php?page=checkout.index&option=com_virtuemart&Itemid=67&redirected=1&Itemid=67

And with SEF :

mydomain.org/store?page=checkout.index&ssl_redirect=1&option=com_virtuemart&Itemid=67

The item ID is there. Everything else except the checkout link works.

Site's URL is http://sister.catchall.stranger.fanzone.org/ . SEF is not activated now.
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: Forrest on May 31, 2011, 19:22:45 pm
Does your checkout give a 404 with SEF off?
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: loppan on May 31, 2011, 20:17:13 pm
Does your checkout give a 404 with SEF off?

Hi forrest, thanks for your reply!

No, everything works perfect with SEF off.

Regards Peter
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: Forrest on May 31, 2011, 21:13:55 pm
Please double-triple check that your site URL and secure URL match in the VM configuration under "Security" tab. The ONLY difference should be an "https" vs "http" if you are using SSL.

Second, turn OFF the cookie check under the VM configuration "Global" settings tab.
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: loppan on May 31, 2011, 21:21:09 pm
Please double-triple check that your site URL and secure URL match in the VM configuration under "Security" tab. The ONLY difference should be an "https" vs "http" if you are using SSL.
I'm not using SSL so the both URL's matches perfectly.

Second, turn OFF the cookie check under the VM configuration "Global" settings tab.
I disabled the cookie check.

Still error 404 :(.
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: Forrest on May 31, 2011, 21:39:28 pm
Ok, I was able to get it to fail, and I was able to get it to work.

PAY CLOSE ATTENTION TO YOUR URLS:
http://sister.catchall.stranger.fanzone.org/index.php/store?page=shop.cart

VS something like:
http://sister.catchall.stranger.fanzone.org/index.php?option=com_virtuemart&page=shop.cart&product_id=3&Itemid=67

Notice one of these URLs has "store?", and the other one is "index.php?"

What's happening is really 2 cart sessions are being created. I've seen this before a few times over, and usually this is an indication of a master/primary link issue!

Depending on how you are accessing the cart page, you'll be successful or fail in your checkout. I suggest you:
1. Turn off your SEF
2. Delete ALL your Joomla menu links to VM.
3. Start over and create one link in menu.
4. Clear cache, test with SEF off.
5. Turn on SEF and test again.

All else fails, ping me here again. And watch those URLS as your browse... they will give you a clue as to what is up!
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: loppan on May 31, 2011, 22:24:57 pm
Wow, I followed your steps and it seems to work now :) I'm amazed.

Thank you for your time Forrest. You just made me very happy :)

EDIT :

Hmmm, all of a sudden it does not work anymore...

This is my URL for showing cart :

http://sister.catchall.stranger.fanzone.org/index.php/store?page=shop.cart

When clicking "Checkout" it turns into this (and error 404)

http://sister.catchall.stranger.fanzone.org/store?page=checkout.index&ssl_redirect=1&option=com_virtuemart&Itemid=85

I can clearly see that the "index.php" right after ...fanzone.org is missing

However, if I add that, the link does not work anyway.

Strange, because I'm really sure it worked a while ago and I cannot remember I changed anything since then...

I've tried clearing the cache etc...

Hmmm! Difficult.
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: Forrest on June 01, 2011, 03:22:11 am
Are you sure you are not creating, or have other links in any Joomla menu to the VM component? This is where the mix-up can happen (multiple links to vm component).

to add to this, my guess is you are creating more links to VM component, but not following the structure in your menu that would be expected by VM.
IE: The menu link to cart should be under the "Store" menu item... not at same level.
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: paulcreedy on June 28, 2011, 10:45:01 am
Sorry to jump onto this topic but it's exactly the problem I'm having.

However I have not created any menu links to the store. Instead I used inserted a virtue mart module "mod_virtuemart " into the left menu.

All works find with SEF turned off. With it turned on the last page on checkout gives a 404 error.

This is the store www.e-procedures.com  currently with SEF off at time of posting this.

I'd really appreciate help in getting this working
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: trendwebsolutions on June 29, 2011, 03:42:10 am
I want to let you all still having trouble in-on what fixed the problem for me...

My issue was after performing an upgrade patch to the latest version, somehow my SEF URLS with sh404sef got tangled up when proceeding with the checkout steps because a new URL was generated for the process after replacing the files... Therefore, the itemID that Joomla gives the default page (IE - Home Page) in the menu (usually your main menu) is 1. So that being said, having the default menu item and its ID as 1 doesn't seem to work if you're having your VM front shop page associated with that item...

So what did I do?

I simply created a new menu item (turned off sh404SEF first, also purged all SEF URLS, and cleared Joomla cache) called "Shop" which Joomla automatically assigned a different itemID (in this case was 10), assigned it to simply the store front of VM, un-published the default menu item "Home", than set the "Shop" menu item as the default. I then erased the old default "Home" item. JOILA, that did it for me. I then turned SEF URLS back on and they worked without a hitch.

Just make sure to follow the steps I mentioned accordingly and this should work for you too. It's in essence what the MOD above said to do, just in a different, more specific fashion. I would also say that if your other URLS aren't working and not just the Store Front URL, then do the same thing and see if it helps.
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: Forrest on July 01, 2011, 00:28:18 am
Txs for share trend...

@paulcreedy: You have your problem because you have NOT created a link to VM! It requires one for proper operation.
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: Tirrawarra on August 11, 2011, 18:28:27 pm
thanks for the article - Im sure #1's got me  (if I turn SEF off alls good - but SEF is important!) however Im a bit lost .. how do I ..

Create a Joomla article page, (I can do that okay)  and enable the Virturemart Module to show on that page, (Ive never put Virtuemart into a page - normally turn on as a menu item)

any help would be appreciated.

thanks Steve
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: Forrest on August 13, 2011, 20:41:12 pm
Steve, create and article, create a menu item to that article, and assign the Virtuemart Module to show on that menu item page.
Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: Tirrawarra on August 13, 2011, 22:36:23 pm
Hi Forrest,
thanks for your help.

I have done a complete new install and followed the procedure (Im pretty sure) to a tee. Although the shop is completely unpopulated -(I was trying to get this right then use as base for 2 shops) -

it fails at the first menu link as soon as I turn "Use Apache mod_rewrite" on.

Ive used the VirtueMart_1.1.8_eCommerceBundle_Joomla_1.5.22.zip
then upgraded Joomla_1.5.22_to_1.5.23-Stable-Patch_Package.zip
then VM 1.1.8 to 1.1.9

site URL and secure URL match in the VM configuration under "Security" tab
turned OFF the cookie check under the VM configuration "Global" settings tab.

with Use Apache mod_rewrite = NO
http://xxx.xx.xx.xx/~account/index.php/component/virtuemart/?page=shop.browse&category=

with Use Apache mod_rewrite = YES
http://xxx.xx.xx.xx/~account/shop-link-article
fails on 404

when I add the index.php  - eg:
http://xxx.xx.xx.xx/~account/index.php/shop-link-article
- it works??

as I said before this is a clean install - no content changes - any ideas?? or would anyone care to look - I would make available to others ?/

thanks Steve








Title: Re: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Post by: twitty1437 on August 15, 2011, 13:50:57 pm
Hi guys, here is what helps me with this bugging problem, i tried this on my fresh install Joomla 1.5.23 and VirtueMart 1.1.19.
http://ktools.eu/en/freeware/joomla/21-virtuemart-sef (http://ktools.eu/en/freeware/joomla/21-virtuemart-sef)
Install the fill following the instructions.

You might need to edit your .htaccess accordingly depends on the type of host you are hosting your website, for me, i do the followings:

1. Comment out
Code: [Select]
Options +FollowSymLinks2. Uncomment
Code: [Select]
RewriteBase /