Our site www.viart.com site is operated by latest Viart Shop 5 with default Clear design
Topic Information
majuki (Guest)
majuki (Guest)
I am trying to use Viart's multisite feature, the first site is say www.abcd.com and the second is www.abcd.com/folderx, in www.abcd.com, the site id was kept 1 while in www.abcd.com/folderx the site id is 2. The va_definitions as well as global settings were set accordingly. But, the strange thing is while accessing www.abcd.com/folderx, all the links are taking to www.abcd.com instead of www.abcd.com/folderx, also a message is appearing in the admin
 
Warning: fread(): supplied argument is not a valid stream resource in C:\Domains\abcd.com\wwwroot\admin\admin_global_settings.php on line 330
 
where I could have gone wrong?
 
majuki (Guest)
majuki (Guest)
ok, could someone let me know if my va_definitions.php is correct or not?
 
Here it goes
 
 
// session settings
$session_prefix = "folderx";
 
// if you use multi-site functionality uncomment the following line and specify appropriate id
$site_id = 2;
 
// if you use VAT validation uncomment the following line
//$vat_validation = true;
// array of country codes for which VAT check is obligatory
//$vat_obligatory_countries = array("GB");
// array of country codes for which remote VAT check won't be run
//$vat_remote_exception_countries = array("NL");
$http_host = $_SERVER["HTTP_HOST"];
 
if (preg_match("/^(www\.)?abcd\.com/folderx$/i", $http_host)) {
 
$site_id = 2;
 
 
} else {
 
$site_id = 1;
 
TOCDCO
TOCDCO
<?php
define("INSTALLED", true); // set to false if you want run install.php
define("DEBUG", true); // debug mode - set false on live site
 
// database parameters
$db_lib = "mysql"; // mysql | postgre | odbc
$db_type = "mysql"; // mysql | postgre | access
$db_name = "DATABASENAME";
$db_host = "localhost";
$db_port = "";
$db_user = "USERNAME";
$db_password = "PASSWORD";
$db_persistent = false;
 
$table_prefix = "va_";
$default_language = "en";
 
// date parameters
$datetime_show_format = array("MM", "/", "DD", "/", "YYYY", ", ", "h", ":", "mm", " ", "AM");
$date_show_format = array("MM", "/", "DD", "/", "YYYY");
$datetime_edit_format = array("MM", "/", "DD", "/", "YYYY", " ", "HH", ":", "mm", ":", "ss");
$date_edit_format = array("MM", "/", "DD", "/", "YYYY");
 
 
// session settings
$session_prefix = "SITENAME";
$site_id = 1;
 
// vat validation
//$vat_validation = true;
//$vat_obligatory_countries = array("GB");
 
?>
 
majuki (Guest)
majuki (Guest)
Thanks Dan,
 
You quoted the top part, I dont think there lies the problem, I quoted the bottom part of the code, where I though the problem could lie, for your convenience, I am reproducing the full code.
 
<?php
 
define("INSTALLED", true); // set to false if you want run install.php
define("DEBUG", true); // debug mode - set false on live site
 
// database parameters
$db_lib = "mysql"; // mysql | postgre | odbc
$db_type = "mysql"; // mysql | postgre | access
$db_name = "DATABASENAME";
$db_host = "localhost";
$db_port = "";
$db_user = "USERNAME";
$db_password = "PASSWORD";
$db_persistent = false;
 
$table_prefix = "va_";
 
$default_language = "en";
 
// date parameters
$datetime_show_format = array("D", " ", "MMM", " ", "YYYY", ", ", "h", ":", "mm", " ", "AM");
$date_show_format = array("D", " ", "MMM", " ", "YYYY");
$datetime_edit_format = array("YYYY", "-", "MM", "-", "DD", " ", "HH", ":", "mm", ":", "ss");
$date_edit_format = array("YYYY", "-", "MM", "-", "DD");
 
// session settings
$session_prefix = "folderx";
 
// if you use multi-site functionality uncomment the following line and specify appropriate id
$site_id = 2;
 
// if you use VAT validation uncomment the following line
//$vat_validation = true;
// array of country codes for which VAT check is obligatory
//$vat_obligatory_countries = array("GB");
// array of country codes for which remote VAT check won't be run
//$vat_remote_exception_countries = array("NL");
$http_host = $_SERVER["HTTP_HOST"];
 
if (preg_match("/^(www\.)?abcd\.com/folderx$/i", $http_host)) {
 
$site_id = 2;
 
 
} else {
 
$site_id = 1;
 
}
?>
 
May be, the problem lies at if (preg_match("/^(www\.)?abcd\.com/folderx$/i", Am I writing it correctly?
 
TOCDCO
TOCDCO
I don't have any of that content in my file, so I'm not sure as to why you've got that extra content?
 
majuki (Guest)
majuki (Guest)
Well, that is because, you are probably not running multi sites, you need to specify which is the primary site and the seconday one's if you are using multisite feature.
 
Mediadot
Mediadot
Have You checked the .htaccess for Your secondary site? Have it got correct path?
 
majuki (Guest)
majuki (Guest)
no, I did not. Do I need to specify a path in .htaccess everytime for viart installation?
 
TOCDCO
TOCDCO
Yes, I am indeed running multi sites... thanks Smile
 
majuki (Guest)
majuki (Guest)
Hi Dan,
 
You are correct, in fact I added that code as the manual says so. See http://www.viart.com/shopping_cart_multisite_feature.html . However, I have been advised by Anjula that it is not required. Maybe, it is meant for previous versions.