Drupal 7 开发内部培训资料, 分头诗人

drupal多站点

赞成!
0
否决!

大体情况: 

1、在集成环境设置apache 的虚拟主机 
# VirtualHost saydrual.com

<VirtualHost *:80>
DocumentRoot "D:/Apache/saydrupal"
ServerName a.dsjz.cn
ServerAlias www.a.dsjz.cn
</virtualhost>
<VirtualHost *:80>
DocumentRoot "D:/Apache/saydrupal"
ServerName b.dsjz.cn
ServerAlias www.b.dsjz.cn
</virtualhost>
<VirtualHost *:80>
DocumentRoot "D:/Apache/saydrupal"
ServerName www.dsjz.cn
ServerAlias dsjz.cn
</virtualhost>

2、在hosts文件添加

127.0.0.1 www.dsjz.cn dsjz.cn

127.0.0.1 a.dsjz.cn www.a.dsjz.cn
127.0.0.1 b.dsjz.cn www.b.dsjz.cn

3、在side文件夹下 建立www.dsjz.cn  a.dsjz.cn b.dsjz.cn  三个文件夹

4、分别访问 www.dsjz.cn a.dsjz.cn b.dsjz.cn 安装drupal
 

问题:当我访问 dsjz.cn 时出现drupal安装界面 不会跳转到 www.dsjz.cn

访问 a.dsjz.cn  b.dsjz.cn 这会跳转
请问这是为什么?

 

 

1 个回答

赞成!
0
否决!

1,

# VirtualHost saydrual.com
<VirtualHost *:80>
DocumentRoot "D:/Apache/saydrupal"
ServerName a.dsjz.cn
ServerAlias www.a.dsjz.cn
</virtualhost>
<VirtualHost *:80>
DocumentRoot "D:/Apache/saydrupal"
ServerName b.dsjz.cn
ServerAlias www.b.dsjz.cn
</virtualhost>
<VirtualHost *:80>
DocumentRoot "D:/Apache/saydrupal"
ServerName www.dsjz.cn
ServerAlias dsjz.cn
</virtualhost>

改为

# VirtualHost saydrual.com
<VirtualHost 127.0.0.2:80>
DocumentRoot "D:/Apache/saydrupal"
ServerName a.dsjz.cn
ServerAlias www.a.dsjz.cn
</virtualhost>
<VirtualHost 127.0.0.3:80>
DocumentRoot "D:/Apache/saydrupal"
ServerName b.dsjz.cn
ServerAlias www.b.dsjz.cn
</virtualhost>
<VirtualHost 127.0.0.4:80>
DocumentRoot "D:/Apache/saydrupal"
ServerName www.dsjz.cn
ServerAlias dsjz.cn
</virtualhost>

2,

127.0.0.1 www.dsjz.cn dsjz.cn
127.0.0.1 a.dsjz.cn www.a.dsjz.cn
127.0.0.1 b.dsjz.cn www.b.dsjz.cn

改为

127.0.0.4 www.dsjz.cn dsjz.cn
127.0.0.2 a.dsjz.cn www.a.dsjz.cn
127.0.0.3 b.dsjz.cn www.b.dsjz.cn