这个问题困惑了我好几天。
我在site->all 下建立了子目录: sub.domain.com,把setting.php也拷贝进去,然后建了一个子域名sub.domain.com指向根目录,要么显示403 错误,要么就显示domain.com的主页。后来才明白是这样的:
把update.php拷贝到根目录下,打开这个链接: http://sub.domain.com/update.com,安装完成后,打开http://sub.domain.com就是另一个界面了。
上面有个错误,用的update.php,安装好后登录后台没有工具条,现成的功能很少。
今天重新作了一遍,记录如下,这次不同的是使用了别名:
1)建立一个子域名:sub.domain.com 指向根目录。
如果用anotherdomain.com作实际的要用的域名,在调试时使用sub.domain.com作别名。这里使用一个文件转换:
将sites目录下的example.sites.php另存为sites.php, 放在同一个目录下,并添加下面的代码:
$sites = array(
'sub.domain.com' => 'anotherdomain.com',
);
将 default.settings.php 另存为 settings.php, 放在目录anotherdomain.com下。
把数据库信息写上:
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'your-database-name',
'username' => 'your-user-name',
'password' => 'your-password',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => 'your-prefix_',
),
),
);
2)把intall.php拷贝到根目录下。
在浏览器地址栏填写: sub.domain.com/install.php, 回车,一步一步会自动安装完成。
然后,sub.domain.com 就是访问的新安装的网站。
把那个sites.php文件去掉,应该就可以用anotherdomain.com直接访问,不过,我还没有试。
补充,放在 all 目录下的themes的theme, 是在sites下的站点yourdomain.com都可以访问到并使用的。