Welcome, Guest. Please login or register.
Login with username, password and session length


Need help or want to talk to other developers? Join the VirtueMart Chat! Read more...

  Advanced search

247038 Posts in 67506 Topics- by 258314 Members - Latest Member: aniketana
VirtueMart ForumVirtueMart 1.1.xSecurity (https) / Performance / SEO/ SEF issuesTroubleshooting SEF: 404, 500, incorrect redirects, and other page errors.
Pages: [1] 2   Go Down
Print
Author Topic: Troubleshooting SEF: 404, 500, incorrect redirects, and other page errors.  (Read 9447 times)
Forrest
Global Moderator
Hero Member
*
Posts: 1907


Me and my bitch


WWW
« on: April 09, 2010, 20:34:52 PM »

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:
  • 404 page
  • redirects to VM category or product pages
  • other redirect issues

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:
  • rename it to "Store" or "Shop" (or whatever your want to signify as your store root)
  • move this link to a Main Level menu item, if it is not already
  • Remove any/all parameters assigned to the VM component menu item (parameters on right of menu item when editing)
  • If this link was a category or product page link, you will need to create a new one.

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:
  • 500 error pages
  • Add to cart button not working with SEF on

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:
  • 500 error pages
  • 404 error pages
  • other redirect issues

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:
  • 500 error pages
  • domain.comdomain.com/index.php...

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:
  • Add to cart button not working SEF on and AJAX.

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:
  • Complete lack of functioning site.
  • 404 pages

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:
  • 404 pages
  • redirects to incorrect VM pages

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".


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

Logged

shv_rk
Jr. Member
**
Posts: 68


« Reply #1 on: May 07, 2010, 05:44:23 AM »

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:
<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
« Last Edit: May 07, 2010, 05:52:25 AM by shv_rk » Logged
Forrest
Global Moderator
Hero Member
*
Posts: 1907


Me and my bitch


WWW
« Reply #2 on: May 07, 2010, 16:16:10 PM »

How about a link to site?
Logged

shv_rk
Jr. Member
**
Posts: 68


« Reply #3 on: May 08, 2010, 04: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!
Logged
Forrest
Global Moderator
Hero Member
*
Posts: 1907


Me and my bitch


WWW
« Reply #4 on: May 08, 2010, 14:02:55 PM »

I would mess with your Itemid=3 in manufacturer source.
Logged

shv_rk
Jr. Member
**
Posts: 68


« Reply #5 on: May 09, 2010, 09:01:31 AM »

Yeah already tryout that.. no hope!  Undecided
Logged
shv_rk
Jr. Member
**
Posts: 68


« Reply #6 on: May 10, 2010, 07:03:56 AM »

even original manufacturer module does not work fine with sh404sef.
it keep directing to index pagw
Logged
Forrest
Global Moderator
Hero Member
*
Posts: 1907


Me and my bitch


WWW
« Reply #7 on: May 10, 2010, 13:39:40 PM »

Maybe a sh404sef issue? I do not use sh404sef, so I'm not of much help with this.
Logged

erick_alcala
Full Member
***
Posts: 154

Everything is Possible!


WWW
« Reply #8 on: June 05, 2010, 09:39:04 AM »

It would be nice to see a tutorial about setting up SEO/SEF in virtuemart. or is there one already ? :O
Logged

wanting to learn to create good templates
joshmayer
Newbie
*
Posts: 1


WWW
« Reply #9 on: March 06, 2011, 11:36:51 AM »

niche share thanks guys..
Logged

Joomla.weblap
Newbie
*
Posts: 3


« Reply #10 on: March 29, 2011, 12:11:59 PM »

I draw your attention to it
http://forum.joomla.org.hu/virtuemart-keresooptimalizalas-t12587.html
without sef unique keywords descriptions to the products
Excuse me for the bad English

Logged
JoomJohnny5
Newbie
*
Posts: 6


« Reply #11 on: April 21, 2011, 03: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.
Logged
naneziris
Newbie
*
Posts: 3


« Reply #12 on: May 02, 2011, 16: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
Logged
valoran
Newbie
*
Posts: 2


« Reply #13 on: May 19, 2011, 10:48:19 AM »

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!
Logged
loppan
Newbie
*
Posts: 32


« Reply #14 on: May 30, 2011, 14: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 Smiley.

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.
« Last Edit: May 30, 2011, 14:50:28 PM by loppan » Logged
Pages: [1] 2   Go Up
Print
Jump to: