Author Topic: Login/out & displaying child prod. common problem  (Read 429 times)


  • Beginner
  • *
  • Posts: 13
Login/out & displaying child prod. common problem
« on: December 09, 2010, 09:54:39 am »
EDIT: I solved this problem with by redirecting all "" to "" with php header("Location:...);
This is a good enough fix for now. If anyone has a more proper solution feel free to share  :). If you want the full php I will post it in a response below. /EDIT


Ive been having trouble for a period of time now with three things that seems to have a common problem/solution.

Prob 1. When logged into backend, navigating to Virtuemart, and to perhaps List products I ALWAYS get logged out. Login again and the problem is gone.

Prob 2. When logging in in frontend I get to the page "Welcome to the user bla bla..." but Im still not logged in. Login again and im logged in.

Prob 3. When at a product in frontend with childproducts (articles), selecting a child product won't change the flypage product information.

I found out ALL these problems have to do with weather I have "http://www.yadayada..." or just "http://yadayada..." in the adress.
If i have "www" I encounter these problems but not without "www".

It appears that javasript files load incorecctly since they are inked without www

I would like to rewrite these links (not the one in backend, I can live with that one) so that it says perhaps "../components/com_virtuemart" etc.

Is this possible?

URL: (try also without www)
Virtuemart ver: 1.1.4

Please help, we're launching the webshop tomorrow!



  • Beginner
  • *
  • Posts: 13
Re: Login/out & displaying child prod. common problem
« Reply #1 on: December 09, 2010, 18:23:07 pm »
This is the php script I used to redirect traffic:

<?php if (function_exists('curPageURL')) {
   echo "";
else {
   function curPageURL() {
 $pageURL = 'http';
 if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
 $pageURL .= "://";
 if ($_SERVER["SERVER_PORT"] != "80") {
 } else {
 return $pageURL;
  $addtoURL=substr(curPageURL(), 11, 200);
if (substr(curPageURL(), 0, 10)==($wwwURL)){
   header("Location: http://" . $addtoURL) ;
   echo "";

Im not an expert in php so maybe you have some modifications to make it better?
All of this is of course before the:

<?php defined( '_JEXEC' ) or die( 'Restricted access' );?>
<?php JHTML::_( 'behavior.modal' ); ?>

Does this change any restrictions or anything like that?