|
One basic problem with running a site is ensuring that people access the correct domain of your site. Without any adjustments, http://mysite.com and http://www.mysite.com are both valid domains.
This causes problems with Cartage, due to the nature of the integration. We need to ensure that only one is used for both Joomla! and Zen Cart™.
Joomla!
Joomla! provides a value in the configuration, of live_site. DO NOT use this for Cartage, as it doesn't respect https links.
Instead, we need to use a htaccess redirect to ensure that the correct domain is always accessed.
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [L,R=301]
This generic code will direct users from mysite.com to www.mysite.com, and only if the domain does not start with www. The opposite of this is a little trickier, so if you decide to go down that route you will need to learn regular expressions.
Zen Cart™
Zen Cart™ is generally correct with it's setup. To check this, view the configure.php file, in both the includes folder and the admin/includes folder. Your first few lines may look similar to this:
define('HTTP_SERVER', "http://mysite.com");
define('HTTPS_SERVER', "https://mysite.com");
As you can see, that doesn't contain the www at the start. Add that in, so it now reads:
define('HTTP_SERVER', "http://www.mysite.com");
define('HTTPS_SERVER', "https://www.mysite.com");
Now both Joomla! and Zen Cart™ are on the same domain, eliminating any potential problems with Cartage Javascript, and ensuring that only one domain will be listed in search engine results.
|