Virtualhost For Wildcard Subdomain and Static Subdomain

前端 未结 3 1614
感动是毒
感动是毒 2020-11-27 09:40

I have an odd situation where I want to have the URLs app1.example.com, example.com and *.example.com all using a different virtual h

3条回答
  •  盖世英雄少女心
    2020-11-27 10:43

    
      DocumentRoot /var/www/app1
      ServerName app1.example.com
    
    
    
      DocumentRoot /var/www/example
      ServerName example.com
    
    
    
      DocumentRoot /var/www/wildcard
      ServerName other.example.com
      ServerAlias *.example.com
    
    

    Should work. The first entry will become the default if you don't get an explicit match. So if you had app.otherexample.com point to it, it would be caught be app1.example.com.

提交回复
热议问题