1

我试图让子域在 Apache 中工作,但它对我不起作用。我已经尝试过Virtualhost For Wildcard Subdomain 和 Static Subdomain。我现在的代码:

<VirtualHost *:80>
DocumentRoot /Bestanden/webserver/vandervoorden.com/other
ServerName other.vandervoorden.com
ServerAlias *.vandervoorden.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /Bestanden/webserver/vandervoorden.com
<Directory "/Bestanden/webserver/vandervoorden.com">
allow from all
Options +Indexes
</Directory>
ServerName vandervoorden.com
</VirtualHost>

第二个 VHost 将对 vandervoorden.com 和 www.vandervoorden.com 做出反应,但是当我浏览到 didtexist.vandervoorden.com 时,我收到一个未找到的页面。

4

1 回答 1

0

您需要配置您的 dns 以返回 didtexist.vandervoorden.com 的 ip

$ dig didntexist.vandervoorden.com A

; <<>> DiG 9.8.3-P1 <<>> didntexist.vandervoorden.com A
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 61164
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;didntexist.vandervoorden.com.  IN  A

;; AUTHORITY SECTION:
vandervoorden.com.  14400   IN  SOA nszero1.axc.nl. hostmaster.vandervoorden.com. 2013071200 14400 3600 1209600 86400

;; Query time: 169 msec
;; SERVER: 129.13.64.5#53(129.13.64.5)
;; WHEN: Mon Jul 15 12:07:03 2013
;; MSG SIZE  rcvd: 107
于 2013-07-15T10:07:59.283 回答