Hi,
I'm trying to manage one site with a store and 2 domain alias that reference to the same place.
the first is
www.domain1.co.uk and the second is
www.domain2.co.uk www.domain1.co.uk is the main domain and the cart work wel without ant problems.
but when im runing the site under the second domain (
www.domain2.co.uk ) the cart is not working well and i got this error:
XMLHttpRequest cannot load
http://www.domain1.co.uk/index.php. Origin
http://www.domain2.co.uk is not allowed by Access-Control-Allow-Origin.
1) I change the virtuemart.php.cfg file
if ($_SERVER['HTTP_HOST'] == "www.domain2.co.uk/") {
define( 'URL', 'http://www.domain2.co.uk/' );
define( 'SECUREURL', 'https://www.domain2.co.uk/' );
} else {
define( 'URL', 'http://www.domain1.co.uk/' );
define( 'SECUREURL', 'https://www.domain1.co.uk/' );
}
2) change htacsses like the sample
http://docs.joomla.org/Multiple_Domains_and_Web_Sites_in_a_single_Joomla!_installation #The following rule works, but it changes which domain name displays.
RewriteCond %{HTTP_HOST} ^(www\.)?redjohnsoncandy\.com$
RewriteRule (.*) http://www.yellowjohnsoncandy.com/index.php?option=com_content&view=category&layout=blog&id=3&Itemid=12 [R=301,L]
any solution will be very helpful !