Appserv: configure multiple sites my website mobile domain m.xxx.com
I want to direct this domain name to an m directory on my server,
I added it to the httpd. conf configuration file.
ServerName "m.xxx.com: 80"
DocumentRoot "D: \ www \ AppServ \ www \ m"
Options Indexes FollowSymLinks
AllowOverride None
Order allow, deny
Allow from all
Is added after Listen 80, and then my domain name resolution m.xxx.com resolves A records to the server IP address
Now, I access both www. xxx. con and m. xxxx. con to access the M Directory of the server, that is, the main domain name also accesses the M directory,
Ask how to allow the primary domain name to access the previous home page and only allow m.xxx.com to access the M Directory of the server.
In addition, on the local machine, configure a normal
ServerName "127.0.0.2: 80"
DocumentRoot "D: \ www \ AppServ \ www \ m"
Options Indexes FollowSymLinks
AllowOverride None
Order allow, deny
Allow from all
127.0.0.1 accesses the PC version, while 127.0.0.2 accesses the mobile version.
Reply to discussion (solution)
Configure www. xxx. con
You are normal locally because the ip address is different.
Configure www. xxx. con
You are normal locally because the ip address is different.
I have configured two
ServerName "www.xxx.net: 80"
DocumentRoot "D: \ www \ AppServ \ www"
Options Indexes FollowSymLinks
AllowOverride None
Order allow, deny
Allow from all
ServerName "m.xxx.net: 80"
DocumentRoot "D: \ www \ AppServ \ www \ m"
Options Indexes FollowSymLinks
AllowOverride None
Order allow, deny
Allow from all
The result is that www.xxx.net and m.xxx.net both access "D: \ www \ AppServ \ www". is The Directory of the PC version incorrect?
ServerName www.xxx.netDocumentRoot "D:\www\AppServ\www"
Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all
ServerName m.xxx.netDocumentRoot "D:\www\AppServ\www\m"
Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all
Thank you very much.