Author Topic: Solution: Can't login after move to new domain or subdomain  (Read 2823 times)

pastvne

  • Beginner
  • *
  • Posts: 12
Solution: Can't login after move to new domain or subdomain
« on: November 18, 2008, 05:16:24 am »
Hi All:
Couldn't find any solutions for this one but invented my own tonight and thought I would share it.

I have a Joomla site with VM1.1 that I backed up and moved to a new test subdomain.  Everything worked except I could not login to the front end using the virtuemart login module on the new subdomain.  If I enabled the standard Joomla login module, I could login. I could login to the back-end but when I went into components > Virtuemart, it remember the original domain and took me back there.

I concluded that the domain URL must be buried somewhere in a config file.  After poking around a bit, I found it at:

mydomain/administrator/components/com_virtuemart/virtuemart.cfg.php

This script contained the following:

Code: [Select]
// these path and url definitions here are based on the Joomla! Configuration
define( 'URL', 'http://my.old.domain/' );
define( 'SECUREURL', 'http://my.old.domain/' );

I changed these to:
Code: [Select]
// these path and url definitions here are based on the Joomla! Configuration
define( 'URL', 'http://my.new.domain/' );
define( 'SECUREURL', 'http://my.new.domain/' );

And this seemed to work.  I expected VM to pickup the domain and automagically adjust but there must be a good reason they have embedded the hard-coded URL into this script.  Maybe it allows the cart to exist across multiple domains or something. 

Anyway, hope this is useful to someone.

punz

  • Beginner
  • *
  • Posts: 30
Re: Solution: Can't login after move to new domain or subdomain
« Reply #1 on: November 20, 2008, 08:06:05 am »
Thanks. Was very helpful.  ;D

cbreninger

  • Beginner
  • *
  • Posts: 38
Re: Solution: Can't login after move to new domain or subdomain
« Reply #2 on: November 20, 2009, 19:15:54 pm »
Right on the money. It was especially a big help after I created a new subdomain (for a site upgrade) and then found VM was not working! Using Joomla 1.5.14 and VM 1.1.3. To see the exact code example was very nice.

Thanks so much for doing this!

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10377
  • VirtueMart Version: 3+
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)