Appserv: configure multiple sites

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.