我的网站移动域名m.xxx.com
我要把这个域名指向我服务器的一个m目录,
我在httpd.conf配置文件里加入
<VirtualHost m.xxx.com:80>
ServerName "m.xxx.com:80"
DocumentRoot "D:wwwAppServwwwm"
<Directory "D:wwwAppServwwwm">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
是在Listen 80后面加入,然后我域名解析m.xxx.com解析A记录到服务器IP地址
现在的情况是我访问www.xxx.con和m.xxxx.con都是访问服务器的M目录,就是主域名也访问M目录了,
请教怎么让主域名访问之前的主页,只让m.xxx.com,访问服务器M目录
另外,我在本机,配置一个正常
<VirtualHost 127.0.0.2:80>
ServerName "127.0.0.2:80"
DocumentRoot "D:wwwAppServwwwm"
<Directory "D:wwwAppServwwwm">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
127.0.0.1 访问PC版,127.0.0.2访问的是移动版
------解决思路----------------------
<VirtualHost *:80>
ServerName www.xxx.net
DocumentRoot "D:wwwAppServwww"
<Directory "D:wwwAppServwww">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName m.xxx.net
DocumentRoot "D:wwwAppServwwwm"
<Directory "D:wwwAppServwwwm">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
友情提示:垃圾评论一律封号 加我微信:826096331拉你进VIP群学习群